vend 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vend/http_client.rb +5 -0
- data/lib/vend/version.rb +1 -1
- data/spec/vend/http_client_spec.rb +1 -0
- metadata +3 -3
data/lib/vend/http_client.rb
CHANGED
@@ -5,6 +5,8 @@ module Vend
|
|
5
5
|
class HttpClient
|
6
6
|
|
7
7
|
UNAUTHORIZED_MESSAGE = "Client not authorized. Check your store URL and credentials are correct and try again."
|
8
|
+
# Read timeout in seconds
|
9
|
+
READ_TIMEOUT = 240
|
8
10
|
|
9
11
|
include Logable
|
10
12
|
|
@@ -27,6 +29,9 @@ module Vend
|
|
27
29
|
http = Net::HTTP.new(host, port)
|
28
30
|
http.use_ssl = true
|
29
31
|
http.verify_mode = verify_mode
|
32
|
+
# Default read_tiemout is 60 seconds, some of the Vend API calls are
|
33
|
+
# taking longer than this.
|
34
|
+
http.read_timeout = READ_TIMEOUT
|
30
35
|
http
|
31
36
|
end
|
32
37
|
|
data/lib/vend/version.rb
CHANGED
@@ -37,6 +37,7 @@ describe Vend::HttpClient do
|
|
37
37
|
subject.stub(:verify_mode => verify_mode)
|
38
38
|
http.should_receive(:use_ssl=).with(true)
|
39
39
|
http.should_receive(:verify_mode=).with(verify_mode)
|
40
|
+
http.should_receive(:read_timeout=).with(240)
|
40
41
|
Net::HTTP.stub(:new).with(host, port) { http }
|
41
42
|
end
|
42
43
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -160,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
segments:
|
162
162
|
- 0
|
163
|
-
hash:
|
163
|
+
hash: 502015210106226139
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
166
|
requirements:
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
segments:
|
171
171
|
- 0
|
172
|
-
hash:
|
172
|
+
hash: 502015210106226139
|
173
173
|
requirements: []
|
174
174
|
rubyforge_project: vend
|
175
175
|
rubygems_version: 1.8.24
|