Class: Cucumber::Wire::Configuration
- Inherits:
-
Object
- Object
- Cucumber::Wire::Configuration
- Defined in:
- lib/cucumber/wire/configuration.rb
Constant Summary collapse
- DEFAULT_TIMEOUTS =
{ 'connect' => 11, 'invoke' => 120, 'begin_scenario' => 120, 'end_scenario' => 120 }
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#unix ⇒ Object
readonly
Returns the value of attribute unix.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ Configuration
constructor
A new instance of Configuration.
- #timeout(message = nil) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 |
# File 'lib/cucumber/wire/configuration.rb', line 14 def initialize(args) @host = args['host'] @port = args['port'] @unix = args['unix'] if RUBY_PLATFORM !~ /mingw|mswin/ @timeouts = DEFAULT_TIMEOUTS.merge(args['timeout'] || {}) end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
7 8 9 |
# File 'lib/cucumber/wire/configuration.rb', line 7 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
7 8 9 |
# File 'lib/cucumber/wire/configuration.rb', line 7 def port @port end |
#unix ⇒ Object (readonly)
Returns the value of attribute unix.
7 8 9 |
# File 'lib/cucumber/wire/configuration.rb', line 7 def unix @unix end |
Class Method Details
.from_file(wire_file) ⇒ Object
9 10 11 12 |
# File 'lib/cucumber/wire/configuration.rb', line 9 def self.from_file(wire_file) settings = YAML.load(ERB.new(File.read(wire_file)).result) new(settings) end |
Instance Method Details
#timeout(message = nil) ⇒ Object
21 22 23 |
# File 'lib/cucumber/wire/configuration.rb', line 21 def timeout( = nil) return @timeouts[.to_s] || 3 end |
#to_s ⇒ Object
25 26 27 28 |
# File 'lib/cucumber/wire/configuration.rb', line 25 def to_s return @unix if @unix "#{@host}:#{@port}" end |