Class: Cucumber::Cli::Configuration
Defined Under Namespace
Classes: LogFormatter
Instance Attribute Summary collapse
Instance Method Summary
collapse
#constantize, #underscore
Constructor Details
#initialize(out_stream = $stdout, error_stream = $stderr) ⇒ Configuration
Returns a new instance of Configuration.
20
21
22
23
24
|
# 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
|
Instance Attribute Details
#out_stream ⇒ Object
Returns the value of attribute out_stream.
18
19
20
|
# File 'lib/cucumber/cli/configuration.rb', line 18
def out_stream
@out_stream
end
|
Instance Method Details
#dry_run? ⇒ Boolean
59
60
61
|
# File 'lib/cucumber/cli/configuration.rb', line 59
def dry_run?
@options[:dry_run]
end
|
#expand? ⇒ Boolean
63
64
65
|
# File 'lib/cucumber/cli/configuration.rb', line 63
def expand?
@options[:expand]
end
|
#fail_fast? ⇒ Boolean
67
68
69
|
# File 'lib/cucumber/cli/configuration.rb', line 67
def fail_fast?
@options[:fail_fast]
end
|
#filters ⇒ Object
99
100
101
|
# File 'lib/cucumber/cli/configuration.rb', line 99
def filters
@options.filters
end
|
103
104
105
|
# File 'lib/cucumber/cli/configuration.rb', line 103
def formats
@options[:formats]
end
|
#guess? ⇒ Boolean
55
56
57
|
# File 'lib/cucumber/cli/configuration.rb', line 55
def guess?
@options[:guess]
end
|
#log ⇒ Object
79
80
81
82
83
84
85
|
# File 'lib/cucumber/cli/configuration.rb', line 79
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 ⇒ Object
95
96
97
|
# File 'lib/cucumber/cli/configuration.rb', line 95
def name_regexps
@options[:name_regexps]
end
|
#parse!(args) ⇒ Object
26
27
28
29
30
31
32
33
|
# 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 ⇒ Object
107
108
109
|
# File 'lib/cucumber/cli/configuration.rb', line 107
def paths
@options[:paths]
end
|
#randomize? ⇒ Boolean
39
40
41
|
# File 'lib/cucumber/cli/configuration.rb', line 39
def randomize?
@options[:order] == 'random'
end
|
#retry_attempts ⇒ Object
71
72
73
|
# File 'lib/cucumber/cli/configuration.rb', line 71
def retry_attempts
@options[:retry]
end
|
#seed ⇒ Object
43
44
45
|
# File 'lib/cucumber/cli/configuration.rb', line 43
def seed
Integer(@options[:seed] || rand(0xFFFF))
end
|
#snippet_type ⇒ Object
75
76
77
|
# File 'lib/cucumber/cli/configuration.rb', line 75
def snippet_type
@options[:snippet_type] || :cucumber_expression
end
|
#strict ⇒ Object
47
48
49
|
# File 'lib/cucumber/cli/configuration.rb', line 47
def strict
@options[:strict]
end
|
#tag_expressions ⇒ Object
91
92
93
|
# File 'lib/cucumber/cli/configuration.rb', line 91
def tag_expressions
@options[:tag_expressions]
end
|
#tag_limits ⇒ Object
87
88
89
|
# File 'lib/cucumber/cli/configuration.rb', line 87
def tag_limits
@options[:tag_limits]
end
|
#to_hash ⇒ Object
111
112
113
|
# File 'lib/cucumber/cli/configuration.rb', line 111
def to_hash
Hash(@options).merge(out_stream: @out_stream, error_stream: @error_stream, seed: seed)
end
|
#verbose? ⇒ Boolean
35
36
37
|
# File 'lib/cucumber/cli/configuration.rb', line 35
def verbose?
@options[:verbose]
end
|
#wip? ⇒ Boolean
51
52
53
|
# File 'lib/cucumber/cli/configuration.rb', line 51
def wip?
@options[:wip]
end
|