aggcat 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,7 +31,7 @@ module Aggcat
31
31
  end
32
32
 
33
33
  def oauth_consumer
34
- @oauth_consumer ||= OAuth::Consumer.new(@consumer_key, @consumer_secret, {timeout: READ_TIMEOUT, open_timeout: OPEN_TIMEOUT, verbose: @verbose})
34
+ @oauth_consumer ||= OAuth::Consumer.new(@consumer_key, @consumer_secret, {timeout: @read_timeout, open_timeout: @open_timeout, verbose: @verbose})
35
35
  end
36
36
 
37
37
  def oauth_token(force=false)
@@ -5,6 +5,8 @@ module Aggcat
5
5
 
6
6
  def initialize(options={})
7
7
  raise ArgumentError.new('customer_id is required for scoping all requests') if options[:customer_id].nil? || options[:customer_id].to_s.empty?
8
+ options[:open_timeout] ||= OPEN_TIMEOUT
9
+ options[:read_timeout] ||= READ_TIMEOUT
8
10
  options[:verbose] ||= false
9
11
  Aggcat::Configurable::KEYS.each do |key|
10
12
  instance_variable_set(:"@#{key}", !options[key].nil? ? options[key] : Aggcat.instance_variable_get(:"@#{key}"))
@@ -1,9 +1,9 @@
1
1
  module Aggcat
2
2
  module Configurable
3
3
 
4
- attr_writer :issuer_id, :consumer_key, :consumer_secret, :certificate_path, :customer_id, :verbose
4
+ attr_writer :issuer_id, :consumer_key, :consumer_secret, :certificate_path, :customer_id, :open_timeout, :read_timeout, :verbose
5
5
 
6
- KEYS = [:issuer_id, :consumer_key, :consumer_secret, :certificate_path, :customer_id, :verbose]
6
+ KEYS = [:issuer_id, :consumer_key, :consumer_secret, :certificate_path, :customer_id, :open_timeout, :read_timeout, :verbose]
7
7
 
8
8
  def configure
9
9
  yield self
@@ -1,3 +1,3 @@
1
1
  module Aggcat
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  end
@@ -16,11 +16,15 @@ class AggcatTest < Test::Unit::TestCase
16
16
  config.consumer_key = 'consumer_key'
17
17
  config.consumer_secret = 'consumer_secret'
18
18
  config.certificate_path = "#{fixture_path}/cert.key"
19
+ config.open_timeout = 5
20
+ config.read_timeout = 30
19
21
  end
20
22
  assert_equal 'issuer_id', configurable.instance_variable_get(:'@issuer_id')
21
23
  assert_equal 'consumer_key', configurable.instance_variable_get(:'@consumer_key')
22
24
  assert_equal 'consumer_secret', configurable.instance_variable_get(:'@consumer_secret')
23
25
  assert_equal "#{fixture_path}/cert.key", configurable.instance_variable_get(:'@certificate_path')
26
+ assert_equal 5, configurable.instance_variable_get(:'@open_timeout')
27
+ assert_equal 30, configurable.instance_variable_get(:'@read_timeout')
24
28
  end
25
29
 
26
30
  def test_scope
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-16 00:00:00.000000000 Z
12
+ date: 2013-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth