excon 0.27.0 → 0.27.1
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.lock +1 -1
- data/changelog.txt +5 -0
- data/excon.gemspec +2 -2
- data/lib/excon.rb +4 -4
- data/lib/excon/connection.rb +15 -9
- data/lib/excon/constants.rb +1 -1
- metadata +3 -3
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.27.
|
17
|
-
s.date = '2013-10-
|
16
|
+
s.version = '0.27.1'
|
17
|
+
s.date = '2013-10-09'
|
18
18
|
s.rubyforge_project = 'excon'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
data/lib/excon.rb
CHANGED
@@ -85,7 +85,7 @@ module Excon
|
|
85
85
|
|
86
86
|
# Status of mocking
|
87
87
|
def mock
|
88
|
-
display_warning("Excon#mock is deprecated,
|
88
|
+
display_warning("Excon#mock is deprecated, use Excon.defaults[:mock] instead (#{caller.first})")
|
89
89
|
self.defaults[:mock]
|
90
90
|
end
|
91
91
|
|
@@ -93,7 +93,7 @@ module Excon
|
|
93
93
|
# false is the default and works as expected
|
94
94
|
# true returns a value from stubs or raises
|
95
95
|
def mock=(new_mock)
|
96
|
-
display_warning("Excon#mock is deprecated,
|
96
|
+
display_warning("Excon#mock is deprecated, use Excon.defaults[:mock]= instead (#{caller.first})")
|
97
97
|
self.defaults[:mock] = new_mock
|
98
98
|
end
|
99
99
|
|
@@ -112,14 +112,14 @@ module Excon
|
|
112
112
|
|
113
113
|
# @return [true, false] Whether or not to verify the peer's SSL certificate / chain
|
114
114
|
def ssl_verify_peer
|
115
|
-
display_warning("Excon#ssl_verify_peer
|
115
|
+
display_warning("Excon#ssl_verify_peer is deprecated, use Excon.defaults[:ssl_verify_peer] instead (#{caller.first})")
|
116
116
|
self.defaults[:ssl_verify_peer]
|
117
117
|
end
|
118
118
|
|
119
119
|
# Change the status of ssl peer verification
|
120
120
|
# @see Excon#ssl_verify_peer (attr_reader)
|
121
121
|
def ssl_verify_peer=(new_ssl_verify_peer)
|
122
|
-
display_warning("Excon#ssl_verify_peer is deprecated, use Excon.defaults[:ssl_verify_peer] instead (#{caller.first})")
|
122
|
+
display_warning("Excon#ssl_verify_peer= is deprecated, use Excon.defaults[:ssl_verify_peer]= instead (#{caller.first})")
|
123
123
|
self.defaults[:ssl_verify_peer] = new_ssl_verify_peer
|
124
124
|
end
|
125
125
|
|
data/lib/excon/connection.rb
CHANGED
@@ -8,16 +8,16 @@ module Excon
|
|
8
8
|
@data
|
9
9
|
end
|
10
10
|
def connection=(new_params)
|
11
|
-
Excon.display_warning("Excon::Connection#connection= is deprecated
|
11
|
+
Excon.display_warning("Excon::Connection#connection= is deprecated. Use of this method may cause unexpected results. (#{caller.first})")
|
12
12
|
@data = new_params
|
13
13
|
end
|
14
14
|
|
15
15
|
def params
|
16
|
-
|
16
|
+
Excon.display_warning("Excon::Connection#params is deprecated use Excon::Connection#data instead (#{caller.first})")
|
17
17
|
@data
|
18
18
|
end
|
19
19
|
def params=(new_params)
|
20
|
-
Excon.display_warning("Excon::Connection#params= is deprecated
|
20
|
+
Excon.display_warning("Excon::Connection#params= is deprecated. Use of this method may cause unexpected results. (#{caller.first})")
|
21
21
|
@data = new_params
|
22
22
|
end
|
23
23
|
|
@@ -26,7 +26,7 @@ module Excon
|
|
26
26
|
@data[:proxy]
|
27
27
|
end
|
28
28
|
def proxy=(new_proxy)
|
29
|
-
Excon.display_warning("Excon::Connection#proxy= is deprecated
|
29
|
+
Excon.display_warning("Excon::Connection#proxy= is deprecated. Use of this method may cause unexpected results. (#{caller.first})")
|
30
30
|
@data[:proxy] = new_proxy
|
31
31
|
end
|
32
32
|
|
@@ -46,7 +46,7 @@ module Excon
|
|
46
46
|
# @option params [Class] :instrumentor Responds to #instrument as in ActiveSupport::Notifications
|
47
47
|
# @option params [String] :instrumentor_name Name prefix for #instrument events. Defaults to 'excon'
|
48
48
|
def initialize(params = {})
|
49
|
-
validate_params!(
|
49
|
+
validate_params!(:connection, params)
|
50
50
|
@data = Excon.defaults.dup
|
51
51
|
# merge does not deep-dup, so make sure headers is not the original
|
52
52
|
@data[:headers] = @data[:headers].dup
|
@@ -228,7 +228,7 @@ module Excon
|
|
228
228
|
# @option params [String] :path appears after 'scheme://host:port/'
|
229
229
|
# @option params [Hash] :query appended to the 'scheme://host:port/path/' in the form of '?key=value'
|
230
230
|
def request(params={}, &block)
|
231
|
-
validate_params!(
|
231
|
+
validate_params!(:request, params)
|
232
232
|
# @data has defaults, merge in new params to override
|
233
233
|
datum = @data.merge(params)
|
234
234
|
datum[:headers] = @data[:headers].merge(datum[:headers] || {})
|
@@ -314,7 +314,7 @@ module Excon
|
|
314
314
|
end
|
315
315
|
|
316
316
|
def retry_limit
|
317
|
-
Excon.display_warning("Excon::Connection#retry_limit is deprecated,
|
317
|
+
Excon.display_warning("Excon::Connection#retry_limit is deprecated, use Excon::Connection#data[:retry_limit]. (#{caller.first})")
|
318
318
|
@data[:retry_limit] ||= DEFAULT_RETRY_LIMIT
|
319
319
|
end
|
320
320
|
|
@@ -354,10 +354,16 @@ module Excon
|
|
354
354
|
end
|
355
355
|
end
|
356
356
|
|
357
|
-
def validate_params!(
|
357
|
+
def validate_params!(validation, params)
|
358
|
+
valid_keys = case validation
|
359
|
+
when :connection
|
360
|
+
VALID_CONNECTION_KEYS
|
361
|
+
when :request
|
362
|
+
VALID_REQUEST_KEYS
|
363
|
+
end
|
358
364
|
invalid_keys = params.keys - valid_keys
|
359
365
|
unless invalid_keys.empty?
|
360
|
-
Excon.display_warning("
|
366
|
+
Excon.display_warning("Invalid Excon #{validation} keys: #{invalid_keys.map(&:inspect).join(', ')}\n#{ caller.join("\n") }")
|
361
367
|
invalid_keys.each {|key| params.delete(key) }
|
362
368
|
end
|
363
369
|
end
|
data/lib/excon/constants.rb
CHANGED
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.27.
|
4
|
+
version: 0.27.1
|
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-10-
|
14
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -243,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
243
|
version: '0'
|
244
244
|
segments:
|
245
245
|
- 0
|
246
|
-
hash:
|
246
|
+
hash: -3897142581279740651
|
247
247
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
248
248
|
none: false
|
249
249
|
requirements:
|