Class: Decko::Commands::CucumberCommand::Parser

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/decko/commands/cucumber_command/parser.rb

Defined Under Namespace

Classes: Flagger

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Parser

Returns a new instance of Parser.



33
34
35
36
37
38
39
40
41
# File 'lib/decko/commands/cucumber_command/parser.rb', line 33

def initialize opts
  super() do |parser|
    parser.banner = "Usage: decko cucumber [DECKO ARGS] -- [CUCUMBER ARGS]\n\n"
    parser.separator "\nDECKO ARGS"
    opts[:env] = ["RAILS_ROOT=. RAILS_ENV=cucumber"]
    Flagger.new(parser, opts).add_flags
    parse_spring parser, opts
  end
end

Instance Method Details

#parse_spring(parser, opts) ⇒ Object



27
28
29
30
31
# File 'lib/decko/commands/cucumber_command/parser.rb', line 27

def parse_spring parser, opts
  parser.on("--[no-]spring", "Run with spring") do |spring|
    opts[:executer] = spring ? "spring" : "bundle exec"
  end
end