Class: CucumberOffRails::Generator::Application

Inherits:
Object
  • Object
show all
Extended by:
Shellwords
Defined in:
lib/cucumber_off_rails/generator/application.rb

Class Method Summary collapse

Class Method Details

.build_options(arguments) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/cucumber_off_rails/generator/application.rb', line 28

def build_options(arguments)
  env_opts_string = ENV['CUCUMBER_OFF_RAILS_OPTS'] || ""
  env_opts        = CucumberOffRails::Generator::Options.new(shellwords(env_opts_string))
  argument_opts   = CucumberOffRails::Generator::Options.new(arguments)

  env_opts.merge(argument_opts)
end

.run!(*arguments) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cucumber_off_rails/generator/application.rb', line 8

def run!(*arguments)
  # cant get options generator included for some reason
  #options = build_options(arguments)
  options = {}

  if options[:invalid_argument]
    $stderr.puts options[:invalid_argument]
    options[:show_help] = true
  end

  if options[:show_help]
    $stderr.puts options.opts
    return 1
  end

  generator = CucumberOffRails::Generator.new(options)
  generator.run
  return 0
end