rest-client 1.6.14 → 1.7.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rest-client might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.gitignore +4 -3
- data/.travis.yml +12 -1
- data/AUTHORS +10 -4
- data/Gemfile +5 -1
- data/LICENSE +21 -0
- data/README.rdoc +27 -2
- data/Rakefile +78 -10
- data/bin/restclient +1 -1
- data/history.md +22 -16
- data/lib/restclient.rb +2 -8
- data/lib/restclient/exceptions.rb +7 -2
- data/lib/restclient/platform.rb +2 -1
- data/lib/restclient/request.rb +270 -48
- data/lib/restclient/response.rb +0 -2
- data/lib/restclient/version.rb +1 -1
- data/lib/restclient/windows.rb +8 -0
- data/lib/restclient/windows/root_certs.rb +105 -0
- data/rest-client.gemspec +14 -10
- data/rest-client.windows.gemspec +19 -0
- data/spec/integration/capath_verisign/415660c1.0 +14 -0
- data/spec/integration/capath_verisign/7651b327.0 +14 -0
- data/spec/integration/capath_verisign/README +8 -0
- data/spec/integration/capath_verisign/verisign.crt +14 -0
- data/spec/{integration_spec.rb → integration/integration_spec.rb} +2 -5
- data/spec/integration/request_spec.rb +46 -17
- data/spec/{base.rb → spec_helper.rb} +2 -3
- data/spec/{abstract_response_spec.rb → unit/abstract_response_spec.rb} +1 -1
- data/spec/{exceptions_spec.rb → unit/exceptions_spec.rb} +1 -4
- data/spec/{master_shake.jpg → unit/master_shake.jpg} +0 -0
- data/spec/{payload_spec.rb → unit/payload_spec.rb} +2 -1
- data/spec/{raw_response_spec.rb → unit/raw_response_spec.rb} +1 -1
- data/spec/{request2_spec.rb → unit/request2_spec.rb} +1 -4
- data/spec/{request_spec.rb → unit/request_spec.rb} +386 -9
- data/spec/{resource_spec.rb → unit/resource_spec.rb} +1 -4
- data/spec/{response_spec.rb → unit/response_spec.rb} +1 -4
- data/spec/{restclient_spec.rb → unit/restclient_spec.rb} +7 -1
- data/spec/unit/windows/root_certs_spec.rb +22 -0
- metadata +93 -58
- data/lib/restclient/net_http_ext.rb +0 -55
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
describe RestClient do
|
4
4
|
describe "API" do
|
@@ -70,4 +70,10 @@ describe RestClient do
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
describe 'version' do
|
74
|
+
it 'has a version ~> 1.7.0.alpha' do
|
75
|
+
ver = Gem::Version.new(RestClient.version)
|
76
|
+
Gem::Requirement.new('~> 1.7.0.alpha').should be_satisfied_by(ver)
|
77
|
+
end
|
78
|
+
end
|
73
79
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'RestClient::Windows::RootCerts',
|
4
|
+
:if => RestClient::Platform.windows? do
|
5
|
+
let(:x509_store) { RestClient::Windows::RootCerts.instance.to_a }
|
6
|
+
|
7
|
+
it 'should return at least one X509 certificate' do
|
8
|
+
expect(x509_store.to_a).to have_at_least(1).items
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should return an X509 certificate with a subject' do
|
12
|
+
x509 = x509_store.first
|
13
|
+
|
14
|
+
expect(x509.subject.to_s).to match(/CN=.*/)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should return X509 certificate objects' do
|
18
|
+
x509_store.each do |cert|
|
19
|
+
cert.should be_a(OpenSSL::X509::Certificate)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,99 +1,119 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- REST Client Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: webmock
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
20
|
-
type: :
|
19
|
+
version: '1.4'
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.4'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: '0'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
56
|
+
name: pry-doc
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - "
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: rdoc
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - "
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 2.4.2
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '5.0'
|
62
79
|
type: :development
|
63
80
|
prerelease: false
|
64
81
|
version_requirements: !ruby/object:Gem::Requirement
|
65
82
|
requirements:
|
66
|
-
- - "
|
83
|
+
- - ">="
|
67
84
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
85
|
+
version: 2.4.2
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '5.0'
|
69
89
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
90
|
+
name: mime-types
|
71
91
|
requirement: !ruby/object:Gem::Requirement
|
72
92
|
requirements:
|
73
93
|
- - "~>"
|
74
94
|
- !ruby/object:Gem::Version
|
75
|
-
version: '2.
|
76
|
-
type: :
|
95
|
+
version: '2.0'
|
96
|
+
type: :runtime
|
77
97
|
prerelease: false
|
78
98
|
version_requirements: !ruby/object:Gem::Requirement
|
79
99
|
requirements:
|
80
100
|
- - "~>"
|
81
101
|
- !ruby/object:Gem::Version
|
82
|
-
version: '2.
|
102
|
+
version: '2.0'
|
83
103
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
104
|
+
name: netrc
|
85
105
|
requirement: !ruby/object:Gem::Requirement
|
86
106
|
requirements:
|
87
|
-
- - "
|
107
|
+
- - "~>"
|
88
108
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :
|
109
|
+
version: '0.7'
|
110
|
+
type: :runtime
|
91
111
|
prerelease: false
|
92
112
|
version_requirements: !ruby/object:Gem::Requirement
|
93
113
|
requirements:
|
94
|
-
- - "
|
114
|
+
- - "~>"
|
95
115
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
116
|
+
version: '0.7'
|
97
117
|
description: 'A simple HTTP and REST client for Ruby, inspired by the Sinatra microframework
|
98
118
|
style of specifying actions: get, put, post, delete.'
|
99
119
|
email: rest.client@librelist.com
|
@@ -109,6 +129,7 @@ files:
|
|
109
129
|
- ".travis.yml"
|
110
130
|
- AUTHORS
|
111
131
|
- Gemfile
|
132
|
+
- LICENSE
|
112
133
|
- README.rdoc
|
113
134
|
- Rakefile
|
114
135
|
- bin/restclient
|
@@ -118,7 +139,6 @@ files:
|
|
118
139
|
- lib/restclient.rb
|
119
140
|
- lib/restclient/abstract_response.rb
|
120
141
|
- lib/restclient/exceptions.rb
|
121
|
-
- lib/restclient/net_http_ext.rb
|
122
142
|
- lib/restclient/payload.rb
|
123
143
|
- lib/restclient/platform.rb
|
124
144
|
- lib/restclient/raw_response.rb
|
@@ -126,26 +146,34 @@ files:
|
|
126
146
|
- lib/restclient/resource.rb
|
127
147
|
- lib/restclient/response.rb
|
128
148
|
- lib/restclient/version.rb
|
149
|
+
- lib/restclient/windows.rb
|
150
|
+
- lib/restclient/windows/root_certs.rb
|
129
151
|
- rest-client.gemspec
|
130
|
-
-
|
131
|
-
- spec/base.rb
|
132
|
-
- spec/exceptions_spec.rb
|
152
|
+
- rest-client.windows.gemspec
|
133
153
|
- spec/integration/capath_digicert/244b5494.0
|
134
154
|
- spec/integration/capath_digicert/81b9768f.0
|
135
155
|
- spec/integration/capath_digicert/README
|
136
156
|
- spec/integration/capath_digicert/digicert.crt
|
157
|
+
- spec/integration/capath_verisign/415660c1.0
|
158
|
+
- spec/integration/capath_verisign/7651b327.0
|
159
|
+
- spec/integration/capath_verisign/README
|
160
|
+
- spec/integration/capath_verisign/verisign.crt
|
137
161
|
- spec/integration/certs/digicert.crt
|
138
162
|
- spec/integration/certs/verisign.crt
|
163
|
+
- spec/integration/integration_spec.rb
|
139
164
|
- spec/integration/request_spec.rb
|
140
|
-
- spec/
|
141
|
-
- spec/
|
142
|
-
- spec/
|
143
|
-
- spec/
|
144
|
-
- spec/
|
145
|
-
- spec/
|
146
|
-
- spec/
|
147
|
-
- spec/
|
148
|
-
- spec/
|
165
|
+
- spec/spec_helper.rb
|
166
|
+
- spec/unit/abstract_response_spec.rb
|
167
|
+
- spec/unit/exceptions_spec.rb
|
168
|
+
- spec/unit/master_shake.jpg
|
169
|
+
- spec/unit/payload_spec.rb
|
170
|
+
- spec/unit/raw_response_spec.rb
|
171
|
+
- spec/unit/request2_spec.rb
|
172
|
+
- spec/unit/request_spec.rb
|
173
|
+
- spec/unit/resource_spec.rb
|
174
|
+
- spec/unit/response_spec.rb
|
175
|
+
- spec/unit/restclient_spec.rb
|
176
|
+
- spec/unit/windows/root_certs_spec.rb
|
149
177
|
homepage: https://github.com/rest-client/rest-client
|
150
178
|
licenses:
|
151
179
|
- MIT
|
@@ -158,35 +186,42 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
186
|
requirements:
|
159
187
|
- - ">="
|
160
188
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
189
|
+
version: 1.9.2
|
162
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
191
|
requirements:
|
164
|
-
- - "
|
192
|
+
- - ">"
|
165
193
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
194
|
+
version: 1.3.1
|
167
195
|
requirements: []
|
168
|
-
|
196
|
+
rubyforge_project:
|
197
|
+
rubygems_version: 2.2.2
|
169
198
|
signing_key:
|
170
199
|
specification_version: 4
|
171
200
|
summary: Simple HTTP and REST client for Ruby, inspired by microframework syntax for
|
172
201
|
specifying actions.
|
173
202
|
test_files:
|
174
|
-
- spec/abstract_response_spec.rb
|
175
|
-
- spec/base.rb
|
176
|
-
- spec/exceptions_spec.rb
|
177
203
|
- spec/integration/capath_digicert/244b5494.0
|
178
204
|
- spec/integration/capath_digicert/81b9768f.0
|
179
205
|
- spec/integration/capath_digicert/README
|
180
206
|
- spec/integration/capath_digicert/digicert.crt
|
207
|
+
- spec/integration/capath_verisign/415660c1.0
|
208
|
+
- spec/integration/capath_verisign/7651b327.0
|
209
|
+
- spec/integration/capath_verisign/README
|
210
|
+
- spec/integration/capath_verisign/verisign.crt
|
181
211
|
- spec/integration/certs/digicert.crt
|
182
212
|
- spec/integration/certs/verisign.crt
|
213
|
+
- spec/integration/integration_spec.rb
|
183
214
|
- spec/integration/request_spec.rb
|
184
|
-
- spec/
|
185
|
-
- spec/
|
186
|
-
- spec/
|
187
|
-
- spec/
|
188
|
-
- spec/
|
189
|
-
- spec/
|
190
|
-
- spec/
|
191
|
-
- spec/
|
192
|
-
- spec/
|
215
|
+
- spec/spec_helper.rb
|
216
|
+
- spec/unit/abstract_response_spec.rb
|
217
|
+
- spec/unit/exceptions_spec.rb
|
218
|
+
- spec/unit/master_shake.jpg
|
219
|
+
- spec/unit/payload_spec.rb
|
220
|
+
- spec/unit/raw_response_spec.rb
|
221
|
+
- spec/unit/request2_spec.rb
|
222
|
+
- spec/unit/request_spec.rb
|
223
|
+
- spec/unit/resource_spec.rb
|
224
|
+
- spec/unit/response_spec.rb
|
225
|
+
- spec/unit/restclient_spec.rb
|
226
|
+
- spec/unit/windows/root_certs_spec.rb
|
227
|
+
has_rdoc:
|
@@ -1,55 +0,0 @@
|
|
1
|
-
module Net
|
2
|
-
class HTTP
|
3
|
-
|
4
|
-
# Adding the patch method if it doesn't exist (rest-client issue: https://github.com/archiloque/rest-client/issues/79)
|
5
|
-
if !defined?(Net::HTTP::Patch)
|
6
|
-
# Code taken from this commit: https://github.com/ruby/ruby/commit/ab70e53ac3b5102d4ecbe8f38d4f76afad29d37d#lib/net/http.rb
|
7
|
-
class Protocol
|
8
|
-
# Sends a PATCH request to the +path+ and gets a response,
|
9
|
-
# as an HTTPResponse object.
|
10
|
-
def patch(path, data, initheader = nil, dest = nil, &block) # :yield: +body_segment+
|
11
|
-
send_entity(path, data, initheader, dest, Patch, &block)
|
12
|
-
end
|
13
|
-
|
14
|
-
# Executes a request which uses a representation
|
15
|
-
# and returns its body.
|
16
|
-
def send_entity(path, data, initheader, dest, type, &block)
|
17
|
-
res = nil
|
18
|
-
request(type.new(path, initheader), data) {|r|
|
19
|
-
r.read_body dest, &block
|
20
|
-
res = r
|
21
|
-
}
|
22
|
-
unless @newimpl
|
23
|
-
res.value
|
24
|
-
return res, res.body
|
25
|
-
end
|
26
|
-
res
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
class Patch < HTTPRequest
|
31
|
-
METHOD = 'PATCH'
|
32
|
-
REQUEST_HAS_BODY = true
|
33
|
-
RESPONSE_HAS_BODY = true
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
#
|
38
|
-
# Replace the request method in Net::HTTP to sniff the body type
|
39
|
-
# and set the stream if appropriate
|
40
|
-
#
|
41
|
-
# Taken from:
|
42
|
-
# http://www.missiondata.com/blog/ruby/29/streaming-data-to-s3-with-ruby/
|
43
|
-
|
44
|
-
alias __request__ request
|
45
|
-
|
46
|
-
def request(req, body=nil, &block)
|
47
|
-
if body != nil && body.respond_to?(:read)
|
48
|
-
req.body_stream = body
|
49
|
-
return __request__(req, nil, &block)
|
50
|
-
else
|
51
|
-
return __request__(req, body, &block)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|