Sha256: e09901db5270e0755892ae7e6c8e79cadb18e007500729e601026b171a92e369

Contents?: true

Size: 656 Bytes

Versions: 45

Compression:

Stored size: 656 Bytes

Contents

require 'yaml'
require 'erb'

module Cucumber
  module WireSupport
    class Configuration
      attr_reader :host, :port
      
      def initialize(wire_file)
        params = YAML.load(ERB.new(File.read(wire_file)).result)
        @host = params['host']
        @port = params['port']
        @timeouts = default_timeouts.merge(params['timeout'] || {})
      end
      
      def timeout(message = nil)
        return @timeouts[message.to_s] || 3
      end
      
      private
      
      def default_timeouts
        {
          'invoke' => 120,
          'begin_scenario' => 120,
          'end_scenario' => 120
        }
      end
    end
  end
end

Version data entries

45 entries across 43 versions & 9 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/wire_support/configuration.rb
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/lib/cucumber/wire_support/configuration.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/wire_support/configuration.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/wire_support/configuration.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/wire_support/configuration.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/wire_support/configuration.rb
casecumber-1.0.2.1 lib/cucumber/wire_support/configuration.rb
casecumber-1.2.1.cb2 lib/cucumber/wire_support/configuration.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/wire_support/configuration.rb
cucumber-1.2.1 lib/cucumber/wire_support/configuration.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/configuration.rb
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/lib/cucumber/wire_support/configuration.rb
cucumber-1.2.0 lib/cucumber/wire_support/configuration.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/configuration.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/configuration.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/configuration.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/configuration.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/configuration.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/configuration.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/wire_support/configuration.rb