Class: GetText::Tools::MsgMerge::Config

### Home Classes Methods

### In Files

- lib/gettext/tools/msgmerge.rb

### Parent

Object

### Methods

- ::new
- #enable_fuzzy_matching?
- #output_obsolete_entries?
- #parse

### Included Modules

- GetText

### Class/Module Index

Quicksearch

- GetText
- GetText::ClassInfo
- GetText::ErbParser
- GetText::GladeParser
- GetText::LocalePath
- GetText::MO
- GetText::MO::HeaderRev1
- GetText::MO::InvalidFormat
- GetText::NoboundTextDomainError
- GetText::PO
- GetText::PO::NonExistentEntryError
- GetText::POEntry
- GetText::POEntry::Formatter
- GetText::POEntry::InvalidTypeError
- GetText::POEntry::NoMsgctxtError
- GetText::POEntry::NoMsgidError
- GetText::POEntry::NoMsgidPluralError
- GetText::POEntryForRubyParser
- GetText::POFormat
- GetText::POParser
- GetText::ParseError
- GetText::RubyParser
- GetText::TextDomain
- GetText::TextDomainGroup
- GetText::TextDomainManager
- GetText::Tools
- GetText::Tools::MsgCat
- GetText::Tools::MsgCat::Config
- GetText::Tools::MsgCat::Merger
- GetText::Tools::MsgInit
- GetText::Tools::MsgInit::ArgumentError
- GetText::Tools::MsgInit::Error
- GetText::Tools::MsgInit::ValidationError
- GetText::Tools::MsgMerge
- GetText::Tools::MsgMerge::Config
- GetText::Tools::MsgMerge::FuzzyEntryFinder
- GetText::Tools::MsgMerge::Merger
- GetText::Tools::Task
- GetText::Tools::Task::Error
- GetText::Tools::Task::Path
- GetText::Tools::Task::ValidationError
- GetText::Tools::XGetText

No matching classes.

# GetText::Tools::MsgMerge::Config

@private

### Attributes

backup[RW]

update mode options

definition_po[RW]
enable_fuzzy_matching[W]

(see enable_fuzzy_matching?)

order[RW]
output[RW]
output_obsolete_entries[W]

(see output_obsolete_entries?)

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 298
    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 329
    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 335
    def output_obsolete_entries?
      @output_obsolete_entries
    end

parse(command_line) click to toggle source

    # File lib/gettext/tools/msgmerge.rb, line 315
    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.