rest-client 2.0.2 → 2.1.0.rc1
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.mailmap +10 -0
- data/.rubocop +2 -0
- data/.rubocop-disables.yml +27 -24
- data/.rubocop.yml +5 -0
- data/.travis.yml +2 -1
- data/AUTHORS +8 -0
- data/README.md +119 -7
- data/Rakefile +12 -4
- data/history.md +33 -0
- data/lib/restclient.rb +0 -1
- data/lib/restclient/abstract_response.rb +28 -2
- data/lib/restclient/exceptions.rb +3 -3
- data/lib/restclient/payload.rb +28 -3
- data/lib/restclient/raw_response.rb +17 -6
- data/lib/restclient/request.rb +89 -67
- data/lib/restclient/resource.rb +16 -6
- data/lib/restclient/response.rb +14 -4
- data/lib/restclient/utils.rb +47 -8
- data/lib/restclient/version.rb +2 -2
- data/rest-client.gemspec +1 -0
- data/spec/ISS.jpg +0 -0
- data/spec/helpers.rb +37 -5
- data/spec/integration/httpbin_spec.rb +41 -0
- data/spec/integration/integration_spec.rb +0 -7
- data/spec/unit/abstract_response_spec.rb +7 -7
- data/spec/unit/payload_spec.rb +51 -19
- data/spec/unit/raw_response_spec.rb +6 -2
- data/spec/unit/request2_spec.rb +8 -8
- data/spec/unit/request_spec.rb +51 -63
- data/spec/unit/resource_spec.rb +7 -7
- data/spec/unit/response_spec.rb +33 -22
- data/spec/unit/restclient_spec.rb +3 -2
- data/spec/unit/utils_spec.rb +10 -10
- metadata +29 -7
- data/spec/unit/master_shake.jpg +0 -0
@@ -71,9 +71,10 @@ describe RestClient do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
describe 'version' do
|
74
|
-
|
74
|
+
# test that there is a sane version number to avoid accidental 0.0.0 again
|
75
|
+
it 'has a version > 2.0.0.alpha, < 3.0' do
|
75
76
|
ver = Gem::Version.new(RestClient.version)
|
76
|
-
expect(Gem::Requirement.new('
|
77
|
+
expect(Gem::Requirement.new('> 2.0.0.alpha', '< 3.0')).to be_satisfied_by(ver)
|
77
78
|
end
|
78
79
|
end
|
79
80
|
end
|
data/spec/unit/utils_spec.rb
CHANGED
@@ -34,11 +34,11 @@ describe RestClient::Utils do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
describe '.cgi_parse_header' do
|
37
|
-
it 'parses headers' do
|
37
|
+
it 'parses headers', :unless => RUBY_VERSION.start_with?('2.0') do
|
38
38
|
expect(RestClient::Utils.cgi_parse_header('text/plain')).
|
39
39
|
to eq ['text/plain', {}]
|
40
40
|
|
41
|
-
expect(RestClient::Utils.cgi_parse_header('text/vnd.just.made.this.up
|
41
|
+
expect(RestClient::Utils.cgi_parse_header('text/vnd.just.made.this.up')).
|
42
42
|
to eq ['text/vnd.just.made.this.up', {}]
|
43
43
|
|
44
44
|
expect(RestClient::Utils.cgi_parse_header('text/plain;charset=us-ascii')).
|
@@ -52,20 +52,20 @@ describe RestClient::Utils do
|
|
52
52
|
to eq ['text/plain', {'charset' => 'us-ascii', 'another' => 'opt'}]
|
53
53
|
|
54
54
|
expect(RestClient::Utils.cgi_parse_header(
|
55
|
-
'
|
56
|
-
to eq ['
|
55
|
+
'foo/bar; filename="silly.txt"')).
|
56
|
+
to eq ['foo/bar', {'filename' => 'silly.txt'}]
|
57
57
|
|
58
58
|
expect(RestClient::Utils.cgi_parse_header(
|
59
|
-
'
|
60
|
-
to eq ['
|
59
|
+
'foo/bar; filename="strange;name"')).
|
60
|
+
to eq ['foo/bar', {'filename' => 'strange;name'}]
|
61
61
|
|
62
62
|
expect(RestClient::Utils.cgi_parse_header(
|
63
|
-
'
|
64
|
-
['
|
63
|
+
'foo/bar; filename="strange;name";size=123')).to eq \
|
64
|
+
['foo/bar', {'filename' => 'strange;name', 'size' => '123'}]
|
65
65
|
|
66
66
|
expect(RestClient::Utils.cgi_parse_header(
|
67
|
-
'
|
68
|
-
['
|
67
|
+
'foo/bar; name="files"; filename="fo\\"o;bar"')).to eq \
|
68
|
+
['foo/bar', {'name' => 'files', 'filename' => 'fo"o;bar'}]
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.1.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: 2017-
|
11
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: webmock
|
@@ -100,6 +100,26 @@ dependencies:
|
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: http-accept
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.7.0
|
110
|
+
- - "<"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '2.0'
|
113
|
+
type: :runtime
|
114
|
+
prerelease: false
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 1.7.0
|
120
|
+
- - "<"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '2.0'
|
103
123
|
- !ruby/object:Gem::Dependency
|
104
124
|
name: http-cookie
|
105
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +185,9 @@ extra_rdoc_files:
|
|
165
185
|
- history.md
|
166
186
|
files:
|
167
187
|
- ".gitignore"
|
188
|
+
- ".mailmap"
|
168
189
|
- ".rspec"
|
190
|
+
- ".rubocop"
|
169
191
|
- ".rubocop-disables.yml"
|
170
192
|
- ".rubocop.yml"
|
171
193
|
- ".travis.yml"
|
@@ -194,6 +216,7 @@ files:
|
|
194
216
|
- lib/restclient/windows/root_certs.rb
|
195
217
|
- rest-client.gemspec
|
196
218
|
- rest-client.windows.gemspec
|
219
|
+
- spec/ISS.jpg
|
197
220
|
- spec/helpers.rb
|
198
221
|
- spec/integration/_lib.rb
|
199
222
|
- spec/integration/capath_digicert/244b5494.0
|
@@ -213,7 +236,6 @@ files:
|
|
213
236
|
- spec/unit/_lib.rb
|
214
237
|
- spec/unit/abstract_response_spec.rb
|
215
238
|
- spec/unit/exceptions_spec.rb
|
216
|
-
- spec/unit/master_shake.jpg
|
217
239
|
- spec/unit/params_array_spec.rb
|
218
240
|
- spec/unit/payload_spec.rb
|
219
241
|
- spec/unit/raw_response_spec.rb
|
@@ -239,17 +261,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
261
|
version: 2.0.0
|
240
262
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
241
263
|
requirements:
|
242
|
-
- - "
|
264
|
+
- - ">"
|
243
265
|
- !ruby/object:Gem::Version
|
244
|
-
version:
|
266
|
+
version: 1.3.1
|
245
267
|
requirements: []
|
246
268
|
rubyforge_project:
|
247
|
-
rubygems_version: 2.6.
|
269
|
+
rubygems_version: 2.6.12
|
248
270
|
signing_key:
|
249
271
|
specification_version: 4
|
250
272
|
summary: Simple HTTP and REST client for Ruby, inspired by microframework syntax for
|
251
273
|
specifying actions.
|
252
274
|
test_files:
|
275
|
+
- spec/ISS.jpg
|
253
276
|
- spec/helpers.rb
|
254
277
|
- spec/integration/_lib.rb
|
255
278
|
- spec/integration/capath_digicert/244b5494.0
|
@@ -269,7 +292,6 @@ test_files:
|
|
269
292
|
- spec/unit/_lib.rb
|
270
293
|
- spec/unit/abstract_response_spec.rb
|
271
294
|
- spec/unit/exceptions_spec.rb
|
272
|
-
- spec/unit/master_shake.jpg
|
273
295
|
- spec/unit/params_array_spec.rb
|
274
296
|
- spec/unit/payload_spec.rb
|
275
297
|
- spec/unit/raw_response_spec.rb
|
data/spec/unit/master_shake.jpg
DELETED
Binary file
|