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 20 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 58 def dry_run? @options[:dry_run] end
expand?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 62 def expand? @options[:expand] end
fail_fast?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 66 def fail_fast? @options[:fail_fast] end
filters()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 98 def filters @options.filters end
formats()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 102 def formats @options[:formats] end
guess?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 54 def guess? @options[:guess] end
log()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 78 def log logger = Logger.new(@out_stream) logger.formatter = LogFormatter.new logger.level = Logger::INFO logger.level = Logger::DEBUG if verbose? logger end
name_regexps()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 94 def name_regexps @options[:name_regexps] end
parse!(args)
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 26 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 106 def paths @options[:paths] end
randomize?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 38 def randomize? @options[:order] == 'random' end
retry_attempts()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 70 def retry_attempts @options[:retry] end
seed()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 42 def seed Integer(@options[:seed] || rand(0xFFFF)) end
snippet_type()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 74 def snippet_type @options[:snippet_type] || :cucumber_expression end
strict()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 46 def strict @options[:strict] end
tag_expressions()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 90 def tag_expressions @options[:tag_expressions] end
tag_limits()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 86 def tag_limits @options[:tag_limits] end
to_hash()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 110 def to_hash Hash(@options).merge(out_stream: @out_stream, error_stream: @error_stream, seed: seed) end
verbose?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 34 def verbose? @options[:verbose] end
wip?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 50 def wip? @options[:wip] end
Private Instance Methods
add_default_formatter()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 138 def add_default_formatter @options[:formats] << ['pretty', {}, @out_stream] end
arrange_formats()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 128 def arrange_formats add_default_formatter if needs_default_formatter? @options[:formats] = @options[:formats].sort_by do |f| f[2] == @out_stream ? -1 : 1 end @options[:formats].uniq! @options.check_formatter_stream_conflicts end
formatter_missing?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 146 def formatter_missing? @options[:formats].empty? end
needs_default_formatter?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 142 def needs_default_formatter? formatter_missing? || publish_only? end
publish_only?()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 150 def publish_only? @options[:formats] .uniq .map { |formatter, _, stream| [formatter, stream] } .uniq .reject { |formatter, stream| formatter == 'message' && stream != @out_stream } .empty? end
set_environment_variables()
click to toggle source
# File lib/cucumber/cli/configuration.rb, line 122 def set_environment_variables @options[:env_vars].each do |var, value| ENV[var] = value end end