Method: GetText::RubyParser.parse

Defined in:
lib/gettext/tools/parser/ruby.rb

.parse(path, options = {}) ⇒ Array<POEntry>

Parses Ruby script located at path.

This is a short cut method. It equals to new(path, options).parse.

Parameters:

  • path (String)

    Ruby script path to be parsed

  • options (Hash) (defaults to: {})

    Options

Options Hash (options):

  • :comment_tag (String, nil)

    The tag to detect comments to be extracted. The extracted comments are used to deliver messages to translators from programmers.

    If the tag is String and a line in a comment start with the tag, the line and the following lines are extracted.

    If the tag is nil, all comments are extracted.

Returns:

  • (Array<POEntry>)

    Extracted messages

See Also:



348
349
350
351
# File 'lib/gettext/tools/parser/ruby.rb', line 348

def parse(path, options={})
  parser = new(path, options)
  parser.parse
end