Sha256: f1de1869062548f9e4331d3e63f6c5908f65c3f2f7a1b93cb424104bdfd57a59

Contents?: true

Size: 829 Bytes

Versions: 40

Compression:

Stored size: 829 Bytes

Contents

require 'yaml'
require 'erb'

module Cucumber
  module WireSupport
    class Configuration
      attr_reader :host, :port, :unix

      def self.from_file(wire_file)
        settings = YAML.load(ERB.new(File.read(wire_file)).result)
        new(settings)
      end

      def initialize(args)
        @host = args['host']
        @port = args['port']
        @unix = args['unix'] if RUBY_PLATFORM !~ /mingw|mswin/
        @timeouts = DEFAULT_TIMEOUTS.merge(args['timeout'] || {})
      end

      def timeout(message = nil)
        return @timeouts[message.to_s] || 3
      end

      def to_s
        return @unix if @unix
        "#{@host}:#{@port}"
      end

      DEFAULT_TIMEOUTS = {
        'connect' => 11,
        'invoke' => 120,
        'begin_scenario' => 120,
        'end_scenario' => 120
      }
    end
  end
end

Version data entries

40 entries across 38 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/lib/cucumber/wire_support/configuration.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/lib/cucumber/wire_support/configuration.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/lib/cucumber/wire_support/configuration.rb
cucumber-2.1.0 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.2 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.1 lib/cucumber/wire_support/configuration.rb
cucumber-1.3.20 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.rc.5 lib/cucumber/wire_support/configuration.rb
cucumber-1.3.19 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.rc.4 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.rc.3 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.rc.2 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.rc.1 lib/cucumber/wire_support/configuration.rb
cucumber-1.3.18 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.beta.5 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.beta.4 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.beta.3 lib/cucumber/wire_support/configuration.rb
cucumber-1.3.17 lib/cucumber/wire_support/configuration.rb
cucumber-2.0.0.beta.2 lib/cucumber/wire_support/configuration.rb