excon 0.29.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of excon might be problematic. Click here for more details.
- data/Gemfile +2 -1
- data/Gemfile.lock +209 -1
- data/changelog.txt +25 -0
- data/excon.gemspec +5 -2
- data/lib/excon.rb +6 -3
- data/lib/excon/connection.rb +23 -9
- data/lib/excon/constants.rb +1 -5
- data/lib/excon/errors.rb +2 -0
- data/lib/excon/middlewares/decompress.rb +23 -6
- data/lib/excon/middlewares/redirect_follower.rb +5 -5
- data/lib/excon/middlewares/response_parser.rb +18 -0
- data/lib/excon/response.rb +58 -31
- data/lib/excon/socket.rb +2 -2
- data/lib/excon/ssl_socket.rb +6 -8
- data/lib/excon/unix_socket.rb +26 -10
- data/lib/excon/utils.rb +16 -0
- data/tests/middlewares/canned_response_tests.rb +27 -0
- data/tests/middlewares/decompress_tests.rb +133 -12
- data/tests/middlewares/redirect_follower_tests.rb +33 -0
- data/tests/requests_tests.rb +28 -0
- data/tests/response_tests.rb +220 -0
- data/tests/servers/good.rb +313 -0
- data/tests/test_helper.rb +14 -0
- metadata +6 -3
data/tests/test_helper.rb
CHANGED
@@ -3,6 +3,12 @@ require 'bundler'
|
|
3
3
|
|
4
4
|
Bundler.require(:default, :development)
|
5
5
|
|
6
|
+
Excon.defaults.merge!(
|
7
|
+
:connect_timeout => 5,
|
8
|
+
:read_timeout => 5,
|
9
|
+
:write_timeout => 5
|
10
|
+
)
|
11
|
+
|
6
12
|
def basic_tests(url = 'http://127.0.0.1:9292', options = {})
|
7
13
|
reset_connection = !!options.delete(:reset_connection)
|
8
14
|
[false, true].each do |nonblock|
|
@@ -208,6 +214,14 @@ ensure
|
|
208
214
|
$VERBOSE = orig_verbose
|
209
215
|
end
|
210
216
|
|
217
|
+
def capture_response_block
|
218
|
+
captures = []
|
219
|
+
yield lambda {|chunk, remaining_bytes, total_bytes|
|
220
|
+
captures << [chunk, remaining_bytes, total_bytes]
|
221
|
+
}
|
222
|
+
captures
|
223
|
+
end
|
224
|
+
|
211
225
|
def rackup_path(*parts)
|
212
226
|
File.expand_path(File.join(File.dirname(__FILE__), 'rackups', *parts))
|
213
227
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-11-
|
14
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -199,6 +199,7 @@ files:
|
|
199
199
|
- tests/data/xs
|
200
200
|
- tests/errors_tests.rb
|
201
201
|
- tests/header_tests.rb
|
202
|
+
- tests/middlewares/canned_response_tests.rb
|
202
203
|
- tests/middlewares/decompress_tests.rb
|
203
204
|
- tests/middlewares/idempotent_tests.rb
|
204
205
|
- tests/middlewares/instrumentation_tests.rb
|
@@ -222,9 +223,11 @@ files:
|
|
222
223
|
- tests/request_headers_tests.rb
|
223
224
|
- tests/request_method_tests.rb
|
224
225
|
- tests/requests_tests.rb
|
226
|
+
- tests/response_tests.rb
|
225
227
|
- tests/servers/bad.rb
|
226
228
|
- tests/servers/eof.rb
|
227
229
|
- tests/servers/error.rb
|
230
|
+
- tests/servers/good.rb
|
228
231
|
- tests/test_helper.rb
|
229
232
|
- tests/thread_safety_tests.rb
|
230
233
|
- tests/timeout_tests.rb
|
@@ -245,7 +248,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
245
248
|
version: '0'
|
246
249
|
segments:
|
247
250
|
- 0
|
248
|
-
hash: -
|
251
|
+
hash: -1886435120012632846
|
249
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
250
253
|
none: false
|
251
254
|
requirements:
|