excon 0.25.1 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/changelog.txt +9 -0
- data/excon.gemspec +4 -2
- data/lib/excon.rb +5 -1
- data/lib/excon/connection.rb +2 -6
- data/lib/excon/constants.rb +2 -1
- data/lib/excon/middlewares/response_parser.rb +12 -0
- data/tests/middlewares/mock_tests.rb +1 -1
- metadata +6 -4
data/Gemfile.lock
CHANGED
data/changelog.txt
CHANGED
data/excon.gemspec
CHANGED
|
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
|
14
14
|
## the sub! line in the Rakefile
|
|
15
15
|
s.name = 'excon'
|
|
16
|
-
s.version = '0.25.
|
|
17
|
-
s.date = '2013-07-
|
|
16
|
+
s.version = '0.25.2'
|
|
17
|
+
s.date = '2013-07-18'
|
|
18
18
|
s.rubyforge_project = 'excon'
|
|
19
19
|
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
|
28
28
|
s.authors = ["dpiddy (Dan Peterson)", "geemus (Wesley Beary)", "nextmat (Matt Sanders)"]
|
|
29
29
|
s.email = 'geemus@gmail.com'
|
|
30
30
|
s.homepage = 'https://github.com/geemus/excon'
|
|
31
|
+
s.license = 'MIT'
|
|
31
32
|
|
|
32
33
|
## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
|
|
33
34
|
## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
|
|
@@ -101,6 +102,7 @@ Gem::Specification.new do |s|
|
|
|
101
102
|
lib/excon/middlewares/idempotent.rb
|
|
102
103
|
lib/excon/middlewares/instrumentor.rb
|
|
103
104
|
lib/excon/middlewares/mock.rb
|
|
105
|
+
lib/excon/middlewares/response_parser.rb
|
|
104
106
|
lib/excon/response.rb
|
|
105
107
|
lib/excon/socket.rb
|
|
106
108
|
lib/excon/ssl_socket.rb
|
data/lib/excon.rb
CHANGED
|
@@ -20,10 +20,13 @@ module Excon
|
|
|
20
20
|
:connect_timeout => 60,
|
|
21
21
|
:debug_request => false,
|
|
22
22
|
:debug_response => false,
|
|
23
|
-
:headers => {
|
|
23
|
+
:headers => {
|
|
24
|
+
'User-Agent' => USER_AGENT
|
|
25
|
+
},
|
|
24
26
|
:idempotent => false,
|
|
25
27
|
:instrumentor_name => 'excon',
|
|
26
28
|
:middlewares => [
|
|
29
|
+
Excon::Middleware::ResponseParser,
|
|
27
30
|
Excon::Middleware::Expects,
|
|
28
31
|
Excon::Middleware::Idempotent,
|
|
29
32
|
Excon::Middleware::Instrumentor,
|
|
@@ -58,6 +61,7 @@ require 'excon/middlewares/expects'
|
|
|
58
61
|
require 'excon/middlewares/idempotent'
|
|
59
62
|
require 'excon/middlewares/instrumentor'
|
|
60
63
|
require 'excon/middlewares/mock'
|
|
64
|
+
require 'excon/middlewares/response_parser'
|
|
61
65
|
require 'excon/response'
|
|
62
66
|
require 'excon/socket'
|
|
63
67
|
require 'excon/ssl_socket'
|
data/lib/excon/connection.rb
CHANGED
|
@@ -105,8 +105,8 @@ module Excon
|
|
|
105
105
|
socket.data = datum
|
|
106
106
|
# start with "METHOD /path"
|
|
107
107
|
request = datum[:method].to_s.upcase << ' '
|
|
108
|
-
if
|
|
109
|
-
request << datum[:scheme] << '://' <<
|
|
108
|
+
if datum[:proxy]
|
|
109
|
+
request << datum[:scheme] << '://' << datum[:host] << port_string(datum)
|
|
110
110
|
end
|
|
111
111
|
request << datum[:path]
|
|
112
112
|
|
|
@@ -346,10 +346,6 @@ module Excon
|
|
|
346
346
|
end
|
|
347
347
|
|
|
348
348
|
def response(datum={})
|
|
349
|
-
unless datum.has_key?(:response)
|
|
350
|
-
datum = Excon::Response.parse(socket, datum)
|
|
351
|
-
end
|
|
352
|
-
|
|
353
349
|
datum[:stack].response_call(datum)
|
|
354
350
|
rescue => error
|
|
355
351
|
case error
|
data/lib/excon/constants.rb
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module Excon
|
|
2
|
+
module Middleware
|
|
3
|
+
class ResponseParser < Excon::Middleware::Base
|
|
4
|
+
def response_call(datum)
|
|
5
|
+
unless datum.has_key?(:response)
|
|
6
|
+
datum = Excon::Response.parse(datum[:connection].send(:socket), datum)
|
|
7
|
+
end
|
|
8
|
+
@stack.response_call(datum)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -85,7 +85,7 @@ Shindo.tests('Excon stubs') do
|
|
|
85
85
|
response.body
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
tests('response.headers').returns({'Host' => '127.0.0.1:9292'}) do
|
|
88
|
+
tests('response.headers').returns({'Host' => '127.0.0.1:9292', 'User-Agent' => "excon/#{Excon::VERSION}"}) do
|
|
89
89
|
response.headers
|
|
90
90
|
end
|
|
91
91
|
|
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.25.
|
|
4
|
+
version: 0.25.2
|
|
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-07-
|
|
14
|
+
date: 2013-07-18 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: activesupport
|
|
@@ -182,6 +182,7 @@ files:
|
|
|
182
182
|
- lib/excon/middlewares/idempotent.rb
|
|
183
183
|
- lib/excon/middlewares/instrumentor.rb
|
|
184
184
|
- lib/excon/middlewares/mock.rb
|
|
185
|
+
- lib/excon/middlewares/response_parser.rb
|
|
185
186
|
- lib/excon/response.rb
|
|
186
187
|
- lib/excon/socket.rb
|
|
187
188
|
- lib/excon/ssl_socket.rb
|
|
@@ -221,7 +222,8 @@ files:
|
|
|
221
222
|
- tests/thread_safety_tests.rb
|
|
222
223
|
- tests/timeout_tests.rb
|
|
223
224
|
homepage: https://github.com/geemus/excon
|
|
224
|
-
licenses:
|
|
225
|
+
licenses:
|
|
226
|
+
- MIT
|
|
225
227
|
post_install_message:
|
|
226
228
|
rdoc_options:
|
|
227
229
|
- --charset=UTF-8
|
|
@@ -235,7 +237,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
235
237
|
version: '0'
|
|
236
238
|
segments:
|
|
237
239
|
- 0
|
|
238
|
-
hash:
|
|
240
|
+
hash: 4254645777267103019
|
|
239
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
242
|
none: false
|
|
241
243
|
requirements:
|