class Cucumber::Cli::Configuration
Attributes
out_stream[R]
Public Class Methods
new(out_stream = STDOUT, error_stream = STDERR)
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 19 def initialize(out_stream = STDOUT, error_stream = STDERR) @out_stream = out_stream @error_stream = error_stream @options = Options.new(@out_stream, @error_stream, :default_profile => 'default') end
Public Instance Methods
dry_run?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 57 def dry_run? @options[:dry_run] end
expand?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 61 def expand? @options[:expand] end
fail_fast?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 65 def fail_fast? !!@options[:fail_fast] end
filters()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 97 def filters @options.filters end
formats()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 101 def formats @options[:formats] end
guess?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 53 def guess? @options[:guess] end
log()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 77 def log logger = Logger.new(@out_stream) logger.formatter = LogFormatter.new logger.level = Logger::INFO logger.level = Logger::DEBUG if self.verbose? logger end
name_regexps()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 93 def name_regexps @options[:name_regexps] end
parse!(args)
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 25 def parse!(args) @args = args @options.parse!(args) arrange_formats raise("You can't use both --strict and --wip") if strict.strict? && wip? set_environment_variables end
paths()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 105 def paths @options[:paths] end
randomize?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 37 def randomize? @options[:order] == 'random' end
retry_attempts()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 69 def retry_attempts @options[:retry] end
seed()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 41 def seed Integer(@options[:seed] || rand(0xFFFF)) end
snippet_type()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 73 def snippet_type @options[:snippet_type] || :cucumber_expression end
strict()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 45 def strict @options[:strict] end
tag_expressions()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 89 def tag_expressions @options[:tag_expressions] end
tag_limits()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 85 def tag_limits @options[:tag_limits] end
to_hash()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 109 def to_hash Hash(@options).merge(out_stream: @out_stream, error_stream: @error_stream) end
verbose?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 33 def verbose? @options[:verbose] end
wip?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 49 def wip? @options[:wip] end
Private Instance Methods
arrange_formats()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 127 def arrange_formats @options[:formats] << ['pretty', {}, @out_stream] if @options[:formats].empty? @options[:formats] = @options[:formats].sort_by do |f| f[2] == @out_stream ? -1 : 1 end @options[:formats].uniq! @options.check_formatter_stream_conflicts() end
set_environment_variables()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 121 def set_environment_variables @options[:env_vars].each do |var, value| ENV[var] = value end end