Class: Cucumber::Cli::Configuration
- Inherits:
-
Object
- Object
- Cucumber::Cli::Configuration
- Includes:
- Cucumber::Constantize
- Defined in:
- lib/cucumber/cli/configuration.rb
Defined Under Namespace
Classes: LogFormatter
Instance Attribute Summary collapse
-
#out_stream ⇒ Object
readonly
Returns the value of attribute out_stream.
Instance Method Summary collapse
- #dry_run? ⇒ Boolean
- #expand? ⇒ Boolean
- #fail_fast? ⇒ Boolean
- #filters ⇒ Object
- #formats ⇒ Object
- #guess? ⇒ Boolean
-
#initialize(out_stream = $stdout, error_stream = $stderr) ⇒ Configuration
constructor
A new instance of Configuration.
- #log ⇒ Object
- #name_regexps ⇒ Object
- #parse!(args) ⇒ Object
- #paths ⇒ Object
- #randomize? ⇒ Boolean
- #retry_attempts ⇒ Object
- #seed ⇒ Object
- #snippet_type ⇒ Object
- #strict ⇒ Object
- #tag_expressions ⇒ Object
- #tag_limits ⇒ Object
- #to_hash ⇒ Object
- #verbose? ⇒ Boolean
- #wip? ⇒ Boolean
Methods included from Cucumber::Constantize
Constructor Details
permalink #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
permalink #out_stream ⇒ Object (readonly)
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
permalink #dry_run? ⇒ Boolean
61 62 63 |
# File 'lib/cucumber/cli/configuration.rb', line 61 def dry_run? @options[:dry_run] end |
permalink #expand? ⇒ Boolean
65 66 67 |
# File 'lib/cucumber/cli/configuration.rb', line 65 def @options[:expand] end |
permalink #fail_fast? ⇒ Boolean
69 70 71 |
# File 'lib/cucumber/cli/configuration.rb', line 69 def fail_fast? @options[:fail_fast] end |
permalink #filters ⇒ Object
[View source] [View on GitHub]
101 102 103 |
# File 'lib/cucumber/cli/configuration.rb', line 101 def filters @options.filters end |
permalink #formats ⇒ Object
[View source] [View on GitHub]
105 106 107 |
# File 'lib/cucumber/cli/configuration.rb', line 105 def formats @options[:formats] end |
permalink #guess? ⇒ Boolean
57 58 59 |
# File 'lib/cucumber/cli/configuration.rb', line 57 def guess? @options[:guess] end |
permalink #log ⇒ Object
[View source] [View on GitHub]
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 |
permalink #name_regexps ⇒ Object
[View source] [View on GitHub]
97 98 99 |
# File 'lib/cucumber/cli/configuration.rb', line 97 def name_regexps @options[:name_regexps] end |
permalink #parse!(args) ⇒ Object
[View source] [View on GitHub]
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 |
permalink #paths ⇒ Object
[View source] [View on GitHub]
109 110 111 |
# File 'lib/cucumber/cli/configuration.rb', line 109 def paths @options[:paths] end |
permalink #randomize? ⇒ Boolean
41 42 43 |
# File 'lib/cucumber/cli/configuration.rb', line 41 def randomize? @options[:order] == 'random' end |
permalink #retry_attempts ⇒ Object
[View source] [View on GitHub]
73 74 75 |
# File 'lib/cucumber/cli/configuration.rb', line 73 def retry_attempts @options[:retry] end |
permalink #seed ⇒ Object
[View source] [View on GitHub]
45 46 47 |
# File 'lib/cucumber/cli/configuration.rb', line 45 def seed Integer(@options[:seed] || rand(0xFFFF)) end |
permalink #snippet_type ⇒ Object
[View source] [View on GitHub]
77 78 79 |
# File 'lib/cucumber/cli/configuration.rb', line 77 def snippet_type @options[:snippet_type] || :cucumber_expression end |
permalink #strict ⇒ Object
[View source] [View on GitHub]
49 50 51 |
# File 'lib/cucumber/cli/configuration.rb', line 49 def strict @options[:strict] end |
permalink #tag_expressions ⇒ Object
[View source] [View on GitHub]
93 94 95 |
# File 'lib/cucumber/cli/configuration.rb', line 93 def tag_expressions @options[:tag_expressions] end |
permalink #tag_limits ⇒ Object
[View source] [View on GitHub]
89 90 91 |
# File 'lib/cucumber/cli/configuration.rb', line 89 def tag_limits @options[:tag_limits] end |
permalink #to_hash ⇒ Object
[View source] [View on GitHub]
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 |
permalink #verbose? ⇒ Boolean
37 38 39 |
# File 'lib/cucumber/cli/configuration.rb', line 37 def verbose? @options[:verbose] end |
permalink #wip? ⇒ Boolean
53 54 55 |
# File 'lib/cucumber/cli/configuration.rb', line 53 def wip? @options[:wip] end |