Module: Dreck

Defined in:
lib/dreck.rb,
lib/dreck/parser.rb,
lib/dreck/result.rb,
lib/dreck/exceptions.rb

Overview

The primary namespace for Dreck.

Defined Under Namespace

Classes: AbsorptionError, BadCountError, DreckError, GreedyAbsorptionError, Parser, ParserError, Result

Constant Summary collapse

VERSION =

Dreck's current version.

"0.2.3"

Class Method Summary collapse

Class Method Details

.parse(args = ARGV, strict: true, &block) ⇒ Result

Parse the given arguments and produce a result.

Parameters:

  • args (Array<String>) (defaults to: ARGV)

    the arguments to parse

  • strict (Boolean) (defaults to: true)

    whether or not to be strict about argument absorption

Returns:

  • (Result)

    the parsing result


14
15
16
17
18
# File 'lib/dreck.rb', line 14

def self.parse(args = ARGV, strict: true, &block)
  result = Result.new(args, strict: strict)
  result.instance_eval(&block)
  result.parse!
end