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
58
59
60
|
# File 'lib/cucumber/cli/configuration.rb', line 58
def dry_run?
@options[:dry_run]
end
|
#expand? ⇒ Boolean
62
63
64
|
# File 'lib/cucumber/cli/configuration.rb', line 62
def expand?
@options[:expand]
end
|
#fail_fast? ⇒ Boolean
66
67
68
|
# File 'lib/cucumber/cli/configuration.rb', line 66
def fail_fast?
@options[:fail_fast]
end
|
#filters ⇒ Object
98
99
100
|
# File 'lib/cucumber/cli/configuration.rb', line 98
def filters
@options.filters
end
|
102
103
104
|
# File 'lib/cucumber/cli/configuration.rb', line 102
def formats
@options[:formats]
end
|
#guess? ⇒ Boolean
54
55
56
|
# File 'lib/cucumber/cli/configuration.rb', line 54
def guess?
@options[:guess]
end
|
#log ⇒ Object
78
79
80
81
82
83
84
|
# 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 ⇒ Object
94
95
96
|
# File 'lib/cucumber/cli/configuration.rb', line 94
def name_regexps
@options[:name_regexps]
end
|
#parse!(args) ⇒ Object
26
27
28
29
30
31
32
|
# 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
106
107
108
|
# File 'lib/cucumber/cli/configuration.rb', line 106
def paths
@options[:paths]
end
|
#randomize? ⇒ Boolean
38
39
40
|
# File 'lib/cucumber/cli/configuration.rb', line 38
def randomize?
@options[:order] == 'random'
end
|
#retry_attempts ⇒ Object
70
71
72
|
# File 'lib/cucumber/cli/configuration.rb', line 70
def retry_attempts
@options[:retry]
end
|
#seed ⇒ Object
42
43
44
|
# File 'lib/cucumber/cli/configuration.rb', line 42
def seed
Integer(@options[:seed] || rand(0xFFFF))
end
|
#snippet_type ⇒ Object
74
75
76
|
# File 'lib/cucumber/cli/configuration.rb', line 74
def snippet_type
@options[:snippet_type] || :cucumber_expression
end
|
#strict ⇒ Object
46
47
48
|
# File 'lib/cucumber/cli/configuration.rb', line 46
def strict
@options[:strict]
end
|
#tag_expressions ⇒ Object
90
91
92
|
# File 'lib/cucumber/cli/configuration.rb', line 90
def tag_expressions
@options[:tag_expressions]
end
|
#tag_limits ⇒ Object
86
87
88
|
# File 'lib/cucumber/cli/configuration.rb', line 86
def tag_limits
@options[:tag_limits]
end
|
#to_hash ⇒ Object
110
111
112
|
# 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? ⇒ Boolean
34
35
36
|
# File 'lib/cucumber/cli/configuration.rb', line 34
def verbose?
@options[:verbose]
end
|
#wip? ⇒ Boolean
50
51
52
|
# File 'lib/cucumber/cli/configuration.rb', line 50
def wip?
@options[:wip]
end
|