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

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

Overview

supports CucumberCommand::Parser class in parsing flags

Instance Method Summary collapse

Constructor Details

#initialize(parser, opts) ⇒ Flagger

Returns a new instance of Flagger.



12
13
14
15
# File 'lib/decko/commands/cucumber_command/parser.rb', line 12

def initialize parser, opts
  @parser = parser
  @opts = opts
end

Instance Method Details

#add_flag(flag, *args) ⇒ Object



24
25
26
# File 'lib/decko/commands/cucumber_command/parser.rb', line 24

def add_flag flag, *args
  @parser.on(*args) { |a| @opts[:env] << "#{flag}=1" if a }
end

#add_flagsObject



17
18
19
20
21
22
# File 'lib/decko/commands/cucumber_command/parser.rb', line 17

def add_flags
  add_flag "DEBUG", "-d", "--debug", "Drop into debugger on failure"
  add_flag "FAST", "-f", "--fast", "Stop on first failure"
  add_flag "LAUNCH", "-l", "--launchy", "Open page on failure"
  add_flag "STEP", "-s", "--step", "Pause after each step"
end