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.
22
23
24
25
26
|
# File 'lib/cucumber/cli/configuration.rb', line 22
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.
20
21
22
|
# File 'lib/cucumber/cli/configuration.rb', line 20
def out_stream
@out_stream
end
|
Instance Method Details
#dry_run? ⇒ Boolean
61
62
63
|
# File 'lib/cucumber/cli/configuration.rb', line 61
def dry_run?
@options[:dry_run]
end
|
#expand? ⇒ Boolean
65
66
67
|
# File 'lib/cucumber/cli/configuration.rb', line 65
def expand?
@options[:expand]
end
|
#fail_fast? ⇒ Boolean
69
70
71
|
# File 'lib/cucumber/cli/configuration.rb', line 69
def fail_fast?
@options[:fail_fast]
end
|
#filters ⇒ Object
101
102
103
|
# File 'lib/cucumber/cli/configuration.rb', line 101
def filters
@options.filters
end
|
105
106
107
|
# File 'lib/cucumber/cli/configuration.rb', line 105
def formats
@options[:formats]
end
|
#guess? ⇒ Boolean
57
58
59
|
# File 'lib/cucumber/cli/configuration.rb', line 57
def guess?
@options[:guess]
end
|
#log ⇒ Object
81
82
83
84
85
86
87
|
# File 'lib/cucumber/cli/configuration.rb', line 81
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
97
98
99
|
# File 'lib/cucumber/cli/configuration.rb', line 97
def name_regexps
@options[:name_regexps]
end
|
#parse!(args) ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/cucumber/cli/configuration.rb', line 28
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
109
110
111
|
# File 'lib/cucumber/cli/configuration.rb', line 109
def paths
@options[:paths]
end
|
#randomize? ⇒ Boolean
41
42
43
|
# File 'lib/cucumber/cli/configuration.rb', line 41
def randomize?
@options[:order] == 'random'
end
|
#retry_attempts ⇒ Object
73
74
75
|
# File 'lib/cucumber/cli/configuration.rb', line 73
def retry_attempts
@options[:retry]
end
|
#seed ⇒ Object
45
46
47
|
# File 'lib/cucumber/cli/configuration.rb', line 45
def seed
Integer(@options[:seed] || rand(0xFFFF))
end
|
#snippet_type ⇒ Object
77
78
79
|
# File 'lib/cucumber/cli/configuration.rb', line 77
def snippet_type
@options[:snippet_type] || :cucumber_expression
end
|
#strict ⇒ Object
49
50
51
|
# File 'lib/cucumber/cli/configuration.rb', line 49
def strict
@options[:strict]
end
|
#tag_expressions ⇒ Object
93
94
95
|
# File 'lib/cucumber/cli/configuration.rb', line 93
def tag_expressions
@options[:tag_expressions]
end
|
#tag_limits ⇒ Object
89
90
91
|
# File 'lib/cucumber/cli/configuration.rb', line 89
def tag_limits
@options[:tag_limits]
end
|
#to_hash ⇒ Object
113
114
115
|
# File 'lib/cucumber/cli/configuration.rb', line 113
def to_hash
Hash(@options).merge(out_stream: @out_stream, error_stream: @error_stream, seed: seed)
end
|
#verbose? ⇒ Boolean
37
38
39
|
# File 'lib/cucumber/cli/configuration.rb', line 37
def verbose?
@options[:verbose]
end
|
#wip? ⇒ Boolean
53
54
55
|
# File 'lib/cucumber/cli/configuration.rb', line 53
def wip?
@options[:wip]
end
|