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