octoparts 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/gemfiles/faraday-0_8_8.gemfile +4 -0
- data/lib/octoparts/client.rb +2 -2
- data/lib/octoparts/version.rb +1 -1
- data/test/test_client.rb +14 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d357c756c7189991f8e42f464d5bd0044c98ff11
|
4
|
+
data.tar.gz: 5480b9895ae46584b71cadf3c9ef01f621f6644d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 555e75e2ead8be1973592df46200d6d96d59b8d6264250c68f6f1c9186f3c9357821b828c50c8114826239be32de927a5e57abd6b99e2ef713527b76890c43d7
|
7
|
+
data.tar.gz: 4120fd06b6a82ce4c231b677fb76e9395b84ca5dabbe82937906b07e90f5bea1fb8c74e19827255d654cf77183386a9910096bffa83d5287f54621c77c4cf299
|
data/.travis.yml
CHANGED
data/lib/octoparts/client.rb
CHANGED
@@ -73,8 +73,8 @@ module Octoparts
|
|
73
73
|
request.url(path, params)
|
74
74
|
request.body = body if body
|
75
75
|
request.headers.merge!(headers)
|
76
|
-
request.options
|
77
|
-
request.options
|
76
|
+
request.options[:timeout] = @timeout_sec if @timeout_sec
|
77
|
+
request.options[:open_timeout] = @open_timeout_sec if @open_timeout_sec
|
78
78
|
end
|
79
79
|
if error = Octoparts::ResponseError.from_response(response)
|
80
80
|
raise error
|
data/lib/octoparts/version.rb
CHANGED
data/test/test_client.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'helper'
|
2
|
+
require 'active_support/core_ext/string/inflections'
|
2
3
|
|
3
4
|
class TestClient < Test::Unit::TestCase
|
4
5
|
def setup
|
@@ -109,14 +110,25 @@ class TestClient < Test::Unit::TestCase
|
|
109
110
|
end
|
110
111
|
|
111
112
|
sub_test_case "timeout" do
|
113
|
+
setup do
|
114
|
+
@endpoint = Octoparts.configuration.endpoint
|
115
|
+
Octoparts.configure do |c|
|
116
|
+
# avoiding connection failed error, sorry heroku...
|
117
|
+
# we should find other way
|
118
|
+
c.endpoint = 'http://octoparts.herokuapp.com'
|
119
|
+
end
|
120
|
+
@exception_class = defined?(Faraday::TimeoutError) ? Faraday::TimeoutError : Faraday::Error::TimeoutError
|
121
|
+
end
|
122
|
+
|
112
123
|
teardown do
|
113
124
|
Octoparts.configure do |c|
|
125
|
+
c.endpoint = @endpoint
|
114
126
|
c.timeout_sec = nil
|
115
127
|
end
|
116
128
|
end
|
117
129
|
|
118
130
|
test "timeout_sec option" do
|
119
|
-
assert_raise
|
131
|
+
assert_raise @exception_class do
|
120
132
|
Octoparts::Client.new(timeout_sec: 0).get('/')
|
121
133
|
end
|
122
134
|
end
|
@@ -125,7 +137,7 @@ class TestClient < Test::Unit::TestCase
|
|
125
137
|
Octoparts.configure do |c|
|
126
138
|
c.timeout_sec = 0
|
127
139
|
end
|
128
|
-
assert_raise
|
140
|
+
assert_raise @exception_class do
|
129
141
|
Octoparts::Client.new.get('/')
|
130
142
|
end
|
131
143
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octoparts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takayuki Matsubara
|
@@ -163,6 +163,7 @@ files:
|
|
163
163
|
- LICENSE.txt
|
164
164
|
- README.md
|
165
165
|
- Rakefile
|
166
|
+
- gemfiles/faraday-0_8_8.gemfile
|
166
167
|
- lib/octoparts.rb
|
167
168
|
- lib/octoparts/builder.rb
|
168
169
|
- lib/octoparts/client.rb
|