Class: GetText::Tools::MsgCat

### Home Classes Methods

### In Files

- lib/gettext/tools/msgcat.rb

### Parent

Object

### Namespace

- CLASS GetText::Tools::MsgCat::Config
- CLASS GetText::Tools::MsgCat::Merger

### Methods

- ::run
- #run

### 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::MsgCat

### Public Class Methods

run(*command_line) click to toggle source

(see run)

This method is provided just for convenience. It equals to `new.run(*command_line)`.

    # File lib/gettext/tools/msgcat.rb, line 31
    def run(*command_line)
      new.run(*command_line)
    end

### Public Instance Methods

run(*command_line) click to toggle source

Concatenates po-files.

@param [Array<String>] command_line

    The command line arguments for rmsgcat.

@return [void]

    # File lib/gettext/tools/msgcat.rb, line 41
    def run(*command_line)
      config = Config.new
      config.parse(command_line)

      parser = POParser.new
      parser.report_warning = config.report_warning?
      parser.ignore_fuzzy = !config.include_fuzzy?
      output_po = PO.new
      output_po.order = config.order
      merger = Merger.new(output_po, config)
      config.pos.each do |po_file_name|
        po = PO.new
        parser.parse_file(po_file_name, po)
        merger.merge(po)
      end

      output_po_string = output_po.to_s(config.po_format_options)
      if config.output.is_a?(String)
        File.open(File.expand_path(config.output), "w") do |file|
          file.print(output_po_string)
        end
      else
        puts(output_po_string)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.