Parent

Included Modules

GetText::Tools::MsgMerge::Config

@private

Attributes

backup[RW]

update mode options

definition_po[RW]
enable_fuzzy_matching[W]
order[RW]
output[RW]
output_obsolete_entries[W]
po_format_options[RW]
reference_pot[RW]
suffix[RW]

update mode options

update[RW]

Public Class Methods

new() click to toggle source

The result is written back to def.po.

--backup=CONTROL        make a backup of def.po
--suffix=SUFFIX         override the usual backup suffix

The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values:

none, off       never make backups (even if --backup is given)
numbered, t     make numbered backups
existing, nil   numbered if numbered backups exist, simple otherwise
simple, never   always make simple backups

The backup suffix is `~', unless set with --suffix or the SIMPLE_BACKUP_SUFFIX environment variable.

# File lib/gettext/tools/msgmerge.rb, line 276
def initialize
  @definition_po = nil
  @reference_po = nil
  @update = false
  @output = nil
  @order = :reference
  @po_format_options = {
    :max_line_width => POEntry::Formatter::DEFAULT_MAX_LINE_WIDTH,
  }
  @enable_fuzzy_matching = true
  @update = nil
  @output_obsolete_entries = true
  @backup = ENV["VERSION_CONTROL"]
  @suffix = ENV["SIMPLE_BACKUP_SUFFIX"] || "~"
  @input_dirs = ["."]
end

Public Instance Methods

enable_fuzzy_matching?() click to toggle source

@return [Bool] true if fuzzy matching is enabled, false otherwise.

# File lib/gettext/tools/msgmerge.rb, line 307
def enable_fuzzy_matching?
  @enable_fuzzy_matching
end
output_obsolete_entries?() click to toggle source

@return [Bool] true if outputting obsolete entries is

enabled, false otherwise.
# File lib/gettext/tools/msgmerge.rb, line 313
def output_obsolete_entries?
  @output_obsolete_entries
end
parse(command_line) click to toggle source
# File lib/gettext/tools/msgmerge.rb, line 293
def parse(command_line)
  parser = create_option_parser
  rest = parser.parse(command_line)

  if rest.size != 2
    puts(parser.help)
    exit(false)
  end

  @definition_po, @reference_pot = rest
  @output = @definition_po if @update
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.