excon 0.9.2 → 0.9.3

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.

@@ -1,3 +1,11 @@
1
+ 0.9.3 12/21/11
2
+ ==============
3
+
4
+ * fix CONSTANTS referenced in SSL_Socket
5
+ * fix default value for proxy in SSL_Socket
6
+ * fix non-regexp header matching
7
+ * return captures from regexp based params
8
+
1
9
  0.9.2 12/16/11
2
10
  ==============
3
11
 
@@ -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.9.2'
17
- s.date = '2011-12-16'
16
+ s.version = '0.9.3'
17
+ s.date = '2011-12-21'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -236,19 +236,24 @@ module Excon
236
236
  end
237
237
 
238
238
  def invoke_stub(params)
239
+ params[:captures] = {:headers => {}} # setup data to hold captures
239
240
  for stub, response in Excon.stubs
240
241
  headers_match = !stub.has_key?(:headers) || stub[:headers].keys.all? do |key|
241
242
  case value = stub[:headers][key]
242
243
  when Regexp
243
- value =~ params[:headers][key]
244
+ value.match(params[:headers][key]) do |match|
245
+ params[:captures][:headers][key] = match.captures
246
+ end
244
247
  else
245
- value =~ params[:headers][key]
248
+ value == params[:headers][key]
246
249
  end
247
250
  end
248
251
  non_headers_match = (stub.keys - [:headers]).all? do |key|
249
252
  case value = stub[key]
250
253
  when Regexp
251
- value =~ params[key]
254
+ value.match(params[key]) do |match|
255
+ params[:captures][key] = match.captures
256
+ end
252
257
  else
253
258
  value == params[key]
254
259
  end
@@ -1,6 +1,6 @@
1
1
  module Excon
2
2
  unless const_defined?(:VERSION)
3
- VERSION = '0.9.2'
3
+ VERSION = '0.9.3'
4
4
  end
5
5
 
6
6
  unless const_defined?(:CHUNK_SIZE)
@@ -17,7 +17,7 @@ module Excon
17
17
 
18
18
  end
19
19
 
20
- def initialize(params = {}, proxy = {})
20
+ def initialize(params = {}, proxy = nil)
21
21
  super
22
22
 
23
23
  # create ssl context
@@ -49,8 +49,8 @@ module Excon
49
49
  @socket.sync_close = true
50
50
 
51
51
  if @proxy
52
- @socket << "CONNECT " << @params[:host] << ":" << @params[:port] << Excon::Connection::HTTP_1_1
53
- @socket << "Host: " << @params[:host] << ":" << @params[:port] << Excon::Connection::CR_NL << Excon::Connection::CR_NL
52
+ @socket << "CONNECT " << @params[:host] << ":" << @params[:port] << Excon::HTTP_1_1
53
+ @socket << "Host: " << @params[:host] << ":" << @params[:port] << Excon::CR_NL << Excon::CR_NL
54
54
 
55
55
  # eat the proxy's connection response
56
56
  while line = @socket.readline.strip
@@ -48,7 +48,7 @@ Shindo.tests('Excon stubs') do
48
48
 
49
49
  Excon.stub({:path => %r{/tests/(\S+)}}) do |params|
50
50
  {
51
- :body => /tests\/(\S+)/.match(params[:path]).captures.first,
51
+ :body => params[:captures][:path].first,
52
52
  :status => 200
53
53
  }
54
54
  end
metadata CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 2
9
- segments_generated: true
10
- version: 0.9.2
8
+ - 3
9
+ version: 0.9.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - dpiddy (Dan Peterson)
@@ -17,11 +16,13 @@ autorequire:
17
16
  bindir: bin
18
17
  cert_chain: []
19
18
 
20
- date: 2011-12-16 00:00:00 -06:00
19
+ date: 2011-12-21 00:00:00 -06:00
21
20
  default_executable:
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
24
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ name: activesupport
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
25
26
  requirements:
26
27
  - - ~>
27
28
  - !ruby/object:Gem::Version
@@ -29,66 +30,61 @@ dependencies:
29
30
  - 3
30
31
  - 1
31
32
  - 3
32
- segments_generated: true
33
33
  version: 3.1.3
34
- requirement: *id001
35
- name: activesupport
36
- prerelease: false
37
34
  type: :development
35
+ version_requirements: *id001
38
36
  - !ruby/object:Gem::Dependency
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ name: delorean
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  segments:
44
44
  - 0
45
- segments_generated: true
46
45
  version: "0"
47
- requirement: *id002
48
- name: delorean
49
- prerelease: false
50
46
  type: :development
47
+ version_requirements: *id002
51
48
  - !ruby/object:Gem::Dependency
52
- version_requirements: &id003 !ruby/object:Gem::Requirement
49
+ name: open4
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
53
52
  requirements:
54
53
  - - ">="
55
54
  - !ruby/object:Gem::Version
56
55
  segments:
57
56
  - 0
58
- segments_generated: true
59
57
  version: "0"
60
- requirement: *id003
61
- name: open4
62
- prerelease: false
63
58
  type: :development
59
+ version_requirements: *id003
64
60
  - !ruby/object:Gem::Dependency
65
- version_requirements: &id004 !ruby/object:Gem::Requirement
61
+ name: rake
62
+ prerelease: false
63
+ requirement: &id004 !ruby/object:Gem::Requirement
66
64
  requirements:
67
65
  - - ">="
68
66
  - !ruby/object:Gem::Version
69
67
  segments:
70
68
  - 0
71
- segments_generated: true
72
69
  version: "0"
73
- requirement: *id004
74
- name: rake
75
- prerelease: false
76
70
  type: :development
71
+ version_requirements: *id004
77
72
  - !ruby/object:Gem::Dependency
78
- version_requirements: &id005 !ruby/object:Gem::Requirement
73
+ name: rdoc
74
+ prerelease: false
75
+ requirement: &id005 !ruby/object:Gem::Requirement
79
76
  requirements:
80
77
  - - ">="
81
78
  - !ruby/object:Gem::Version
82
79
  segments:
83
80
  - 0
84
- segments_generated: true
85
81
  version: "0"
86
- requirement: *id005
87
- name: rdoc
88
- prerelease: false
89
82
  type: :development
83
+ version_requirements: *id005
90
84
  - !ruby/object:Gem::Dependency
91
- version_requirements: &id006 !ruby/object:Gem::Requirement
85
+ name: shindo
86
+ prerelease: false
87
+ requirement: &id006 !ruby/object:Gem::Requirement
92
88
  requirements:
93
89
  - - "="
94
90
  - !ruby/object:Gem::Version
@@ -96,25 +92,21 @@ dependencies:
96
92
  - 0
97
93
  - 2
98
94
  - 0
99
- segments_generated: true
100
95
  version: 0.2.0
101
- requirement: *id006
102
- name: shindo
103
- prerelease: false
104
96
  type: :development
97
+ version_requirements: *id006
105
98
  - !ruby/object:Gem::Dependency
106
- version_requirements: &id007 !ruby/object:Gem::Requirement
99
+ name: sinatra
100
+ prerelease: false
101
+ requirement: &id007 !ruby/object:Gem::Requirement
107
102
  requirements:
108
103
  - - ">="
109
104
  - !ruby/object:Gem::Version
110
105
  segments:
111
106
  - 0
112
- segments_generated: true
113
107
  version: "0"
114
- requirement: *id007
115
- name: sinatra
116
- prerelease: false
117
108
  type: :development
109
+ version_requirements: *id007
118
110
  description: EXtended http(s) CONnections
119
111
  email: geemus@gmail.com
120
112
  executables: []
@@ -187,7 +179,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
179
  - !ruby/object:Gem::Version
188
180
  segments:
189
181
  - 0
190
- segments_generated: true
191
182
  version: "0"
192
183
  required_rubygems_version: !ruby/object:Gem::Requirement
193
184
  requirements:
@@ -195,7 +186,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
186
  - !ruby/object:Gem::Version
196
187
  segments:
197
188
  - 0
198
- segments_generated: true
199
189
  version: "0"
200
190
  requirements: []
201
191