rest 2.7.1 → 2.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/rest/client.rb +8 -0
- data/lib/rest/version.rb +1 -1
- data/lib/rest/wrappers/excon_wrapper.rb +12 -0
- data/lib/rest/wrappers/net_http_persistent_wrapper.rb +16 -0
- data/lib/rest/wrappers/rest_client_wrapper.rb +15 -0
- data/lib/rest/wrappers/typhoeus_wrapper.rb +8 -0
- metadata +23 -23
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZWJlYTZlYTNkZmFjZGRiNTVlOTgwYmEzY2RmZWUxODU3MzA2MDNiMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzdmYjM5NDBhYzMxZjgyZjMyOGE3ZGRiNDZlODI2N2RlNWNiNTI3MQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NTAwZTBkODBhMTg3MmVlMGE0ZWViNjZhMTk2Y2FmZDc5N2QyYzAxYzJmYWE0
|
10
|
+
ZWZlYjk3M2E0OTRlMWQ5ZTE2MDZkMzQ4NWJmNjZiMWJjODhmZWJjMjE0NzAz
|
11
|
+
NjIzMWZhOWRhZDg2MzY3ZDVkMTBiZDI5NGJmZjdmMWFmOTNkZDY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjAzNjYxMDljOTljNzQ1Y2RiNTRmMmI2NjlmYjYxN2MxOTM3OTlmZjlmMDFi
|
14
|
+
YWU3YWU2OGZmZWRhMTIyNzBiY2U1ZjE0Njk1MGY2M2FiNmFlMjVhMWNmOWE1
|
15
|
+
NDM3NzYxMDZiNzllZWEzMjM5MTg5N2EyMjBiMjZhZmI0MTA0ZGU=
|
data/lib/rest/client.rb
CHANGED
@@ -205,6 +205,14 @@ module Rest
|
|
205
205
|
return res
|
206
206
|
end
|
207
207
|
|
208
|
+
def patch(url, req_hash={})
|
209
|
+
res = nil
|
210
|
+
res = perform_op(:patch, req_hash) do
|
211
|
+
res = @wrapper.patch(url, req_hash)
|
212
|
+
end
|
213
|
+
return res
|
214
|
+
end
|
215
|
+
|
208
216
|
def delete(url, req_hash={})
|
209
217
|
res = nil
|
210
218
|
res = perform_op(:delete, req_hash) do
|
data/lib/rest/version.rb
CHANGED
@@ -93,6 +93,18 @@ module Rest
|
|
93
93
|
response
|
94
94
|
end
|
95
95
|
|
96
|
+
def patch(url, req_hash={})
|
97
|
+
response = nil
|
98
|
+
begin
|
99
|
+
req_hash[:method] = :patch
|
100
|
+
req_hash[:url] = url
|
101
|
+
response = excon_request(url, req_hash)
|
102
|
+
rescue RestClient::Exception => ex
|
103
|
+
raise RestClientExceptionWrapper.new(ex)
|
104
|
+
end
|
105
|
+
response
|
106
|
+
end
|
107
|
+
|
96
108
|
def delete(url, req_hash={})
|
97
109
|
response = nil
|
98
110
|
begin
|
@@ -178,6 +178,22 @@ module Rest
|
|
178
178
|
r
|
179
179
|
end
|
180
180
|
|
181
|
+
def patch(url, req_hash={})
|
182
|
+
r = nil
|
183
|
+
uri = URI(url)
|
184
|
+
append_query_params(req_hash, uri)
|
185
|
+
post = Net::HTTP::Patch.new fix_path(uri.request_uri)
|
186
|
+
add_headers(post, req_hash, default_headers)
|
187
|
+
post.body = stringed_body(req_hash[:body]) if req_hash[:body]
|
188
|
+
response = http.request uri, post
|
189
|
+
r = NetHttpPersistentResponseWrapper.new(response)
|
190
|
+
case response
|
191
|
+
when Net::HTTPClientError, Net::HTTPServerError
|
192
|
+
raise Rest::HttpError.new(r, r.code.to_i)
|
193
|
+
end
|
194
|
+
r
|
195
|
+
end
|
196
|
+
|
181
197
|
def delete(url, req_hash={})
|
182
198
|
r = nil
|
183
199
|
uri = URI(url)
|
@@ -91,6 +91,21 @@ module Rest
|
|
91
91
|
response
|
92
92
|
end
|
93
93
|
|
94
|
+
def patch(url, req_hash={})
|
95
|
+
response = nil
|
96
|
+
begin
|
97
|
+
req_hash[:method] = :patch
|
98
|
+
req_hash[:url] = url
|
99
|
+
req_hash[:payload] = req_hash[:body] if req_hash[:body]
|
100
|
+
r2 = RestClient::Request.execute(req_hash)
|
101
|
+
response = RestClientResponseWrapper.new(r2)
|
102
|
+
rescue RestClient::Exception => ex
|
103
|
+
raise RestClientExceptionWrapper.new(ex)
|
104
|
+
end
|
105
|
+
response
|
106
|
+
end
|
107
|
+
|
108
|
+
|
94
109
|
def delete(url, req_hash={})
|
95
110
|
response = nil
|
96
111
|
begin
|
@@ -83,6 +83,14 @@ module Rest
|
|
83
83
|
response
|
84
84
|
end
|
85
85
|
|
86
|
+
def patch(url, req_hash={})
|
87
|
+
req_hash = default_typhoeus_options.merge(req_hash)
|
88
|
+
# puts "REQ_HASH=" + req_hash.inspect
|
89
|
+
response = Typhoeus::Request.patch(url, req_hash)
|
90
|
+
response = handle_response(response)
|
91
|
+
response
|
92
|
+
end
|
93
|
+
|
86
94
|
def delete(url, req_hash={})
|
87
95
|
req_hash = default_typhoeus_options.merge(req_hash)
|
88
96
|
response = Typhoeus::Request.delete(url, req_hash)
|
metadata
CHANGED
@@ -1,139 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Reeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest_client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '>='
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.7.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '>='
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.7.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: net-http-persistent
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.9.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.9.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: typhoeus
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - '>='
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.5.4
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - '>='
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.5.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: test-unit
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - '>='
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - '>='
|
66
|
+
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - '>='
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - '>='
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - '>='
|
87
|
+
- - ! '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - '>='
|
94
|
+
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: uber_config
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - '>='
|
101
|
+
- - ! '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - '>='
|
108
|
+
- - ! '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: quicky
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - '>='
|
115
|
+
- - ! '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 0.4.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - '>='
|
122
|
+
- - ! '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 0.4.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: excon
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - '>='
|
129
|
+
- - ! '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - '>='
|
136
|
+
- - ! '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
description: Rest client wrapper that chooses best installed client.
|
@@ -172,17 +172,17 @@ require_paths:
|
|
172
172
|
- lib
|
173
173
|
required_ruby_version: !ruby/object:Gem::Requirement
|
174
174
|
requirements:
|
175
|
-
- - '>='
|
175
|
+
- - ! '>='
|
176
176
|
- !ruby/object:Gem::Version
|
177
177
|
version: '1.8'
|
178
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
179
|
requirements:
|
180
|
-
- - '>='
|
180
|
+
- - ! '>='
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: 1.3.6
|
183
183
|
requirements: []
|
184
184
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.
|
185
|
+
rubygems_version: 2.2.2
|
186
186
|
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Rest client wrapper that chooses best installed client.
|