rest-client 1.6.7 → 2.1.0

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.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.mailmap +10 -0
  4. data/.rspec +2 -0
  5. data/.rubocop +2 -0
  6. data/.rubocop-disables.yml +386 -0
  7. data/.rubocop.yml +8 -0
  8. data/.travis.yml +62 -0
  9. data/AUTHORS +106 -0
  10. data/Gemfile +11 -0
  11. data/LICENSE +21 -0
  12. data/README.md +901 -0
  13. data/Rakefile +109 -35
  14. data/bin/restclient +11 -12
  15. data/history.md +244 -1
  16. data/lib/restclient.rb +27 -18
  17. data/lib/restclient/abstract_response.rb +197 -51
  18. data/lib/restclient/exceptions.rb +110 -59
  19. data/lib/restclient/params_array.rb +72 -0
  20. data/lib/restclient/payload.rb +74 -75
  21. data/lib/restclient/platform.rb +49 -0
  22. data/lib/restclient/raw_response.rb +21 -6
  23. data/lib/restclient/request.rb +747 -183
  24. data/lib/restclient/resource.rb +22 -13
  25. data/lib/restclient/response.rb +75 -9
  26. data/lib/restclient/utils.rb +274 -0
  27. data/lib/restclient/version.rb +8 -0
  28. data/lib/restclient/windows.rb +8 -0
  29. data/lib/restclient/windows/root_certs.rb +105 -0
  30. data/rest-client.gemspec +32 -0
  31. data/rest-client.windows.gemspec +19 -0
  32. data/spec/ISS.jpg +0 -0
  33. data/spec/helpers.rb +54 -0
  34. data/spec/integration/_lib.rb +1 -0
  35. data/spec/integration/capath_digicert/3513523f.0 +22 -0
  36. data/spec/integration/capath_digicert/399e7759.0 +22 -0
  37. data/spec/integration/capath_digicert/README +8 -0
  38. data/spec/integration/capath_digicert/digicert.crt +22 -0
  39. data/spec/integration/capath_verisign/415660c1.0 +14 -0
  40. data/spec/integration/capath_verisign/7651b327.0 +14 -0
  41. data/spec/integration/capath_verisign/README +8 -0
  42. data/spec/integration/capath_verisign/verisign.crt +14 -0
  43. data/spec/integration/certs/digicert.crt +22 -0
  44. data/spec/integration/httpbin_spec.rb +128 -0
  45. data/spec/integration/integration_spec.rb +118 -0
  46. data/spec/integration/request_spec.rb +109 -7
  47. data/spec/spec_helper.rb +29 -0
  48. data/spec/unit/_lib.rb +1 -0
  49. data/spec/unit/abstract_response_spec.rb +145 -0
  50. data/spec/unit/exceptions_spec.rb +108 -0
  51. data/spec/unit/params_array_spec.rb +36 -0
  52. data/spec/unit/payload_spec.rb +295 -0
  53. data/spec/unit/raw_response_spec.rb +22 -0
  54. data/spec/unit/request2_spec.rb +54 -0
  55. data/spec/unit/request_spec.rb +1238 -0
  56. data/spec/unit/resource_spec.rb +134 -0
  57. data/spec/unit/response_spec.rb +252 -0
  58. data/spec/unit/restclient_spec.rb +80 -0
  59. data/spec/unit/utils_spec.rb +147 -0
  60. data/spec/unit/windows/root_certs_spec.rb +22 -0
  61. metadata +265 -117
  62. data/README.rdoc +0 -285
  63. data/VERSION +0 -1
  64. data/lib/restclient/net_http_ext.rb +0 -55
  65. data/spec/abstract_response_spec.rb +0 -85
  66. data/spec/base.rb +0 -16
  67. data/spec/exceptions_spec.rb +0 -98
  68. data/spec/integration/certs/equifax.crt +0 -19
  69. data/spec/integration_spec.rb +0 -38
  70. data/spec/master_shake.jpg +0 -0
  71. data/spec/payload_spec.rb +0 -234
  72. data/spec/raw_response_spec.rb +0 -17
  73. data/spec/request2_spec.rb +0 -40
  74. data/spec/request_spec.rb +0 -529
  75. data/spec/resource_spec.rb +0 -134
  76. data/spec/response_spec.rb +0 -169
  77. data/spec/restclient_spec.rb +0 -73
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e61fb064d966989b00da05fc3e16e3c389cebb68de302d1436e9e2be10dbef8c
4
+ data.tar.gz: fa5deab3c8c4a44e2d5478e212dd24221d37812f818d4e8cb63e65ebafd8e85c
5
+ SHA512:
6
+ metadata.gz: ca5026c1f26f1c465c0e2ed869c1a6f6f0dc3b229843d972f9c0267d2f25e98565a672a91b899796d5494391bac73b35d3f36782f0b4afdade1b4d525e09307a
7
+ data.tar.gz: 8ce3970ab67e95e68cfce154ed6865285f04f0e493c694a7014dee54901a9d64759299bf43c542ce23baf05e15676c9daebd5fa4c53703891cdf179a6a0cf769
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ *.gem
2
+ /Gemfile.lock
3
+ /.bundle
4
+ /vendor
5
+ /doc
6
+ /pkg
7
+ /rdoc
8
+ /.yardoc
9
+ /tmp
data/.mailmap ADDED
@@ -0,0 +1,10 @@
1
+ Blake Mizerany <blake.mizerany@gmail.com>
2
+ Lawrence Leonard Gilbert <larry@l2g.to>
3
+ <larry@l2g.to> <larry@L2G.to>
4
+ Marc-André Cournoyer <macournoyer@gmail.com>
5
+ Matthew Manning <matt.manning@gmail.com>
6
+ Nicholas Wieland <nicholas.wieland@gmail.com>
7
+ Rafael Ssouza <rafael.ssouza@gmail.com>
8
+ Richard Schneeman <richard.schneeman@gmail.com>
9
+ Rick Olson <technoweenie@gmail.com>
10
+ T. Watanabe <wtnabe@wt-srv.watanabe>
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/.rubocop ADDED
@@ -0,0 +1,2 @@
1
+ --display-cop-names
2
+ --fail-level=W
@@ -0,0 +1,386 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2014-07-08 08:57:44 +0000 using RuboCop version 0.24.1.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # TODO
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ Lint/StringConversionInInterpolation:
12
+ Enabled: false
13
+
14
+ # Tests only
15
+ # Offense count: 16
16
+ # Cop supports --auto-correct.
17
+ Lint/UnusedBlockArgument:
18
+ Enabled: false
19
+
20
+ Security/Eval:
21
+ Exclude:
22
+ - rest-client.windows.gemspec
23
+
24
+ Lint/HandleExceptions:
25
+ Exclude:
26
+ - lib/restclient/utils.rb
27
+
28
+ Lint/UselessAccessModifier:
29
+ Exclude:
30
+ - lib/restclient/windows/root_certs.rb
31
+
32
+ # Offense count: 4
33
+ # Cop supports --auto-correct.
34
+ Style/Alias:
35
+ Enabled: false
36
+
37
+ # TODO
38
+ # Offense count: 3
39
+ # Cop supports --auto-correct.
40
+ Style/AndOr:
41
+ Enabled: false
42
+
43
+ # TODO
44
+ # Offense count: 3
45
+ # Cop supports --auto-correct.
46
+ Style/BlockDelimiters:
47
+ Enabled: false
48
+
49
+ # Offense count: 48
50
+ # Cop supports --auto-correct.
51
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
52
+ Style/BracesAroundHashParameters:
53
+ Enabled: false
54
+
55
+ # Offense count: 1
56
+ Naming/ClassAndModuleCamelCase:
57
+ Exclude:
58
+ - lib/restclient/windows/root_certs.rb
59
+
60
+ # Offense count: 2
61
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
62
+ Style/ClassAndModuleChildren:
63
+ Enabled: false
64
+
65
+ # TODO?
66
+ # Offense count: 14
67
+ Metrics/AbcSize:
68
+ Max: 75
69
+
70
+ # TODO?
71
+ Metrics/MethodLength:
72
+ Max: 66
73
+
74
+ # TODO?
75
+ # Offense count: 4
76
+ Metrics/PerceivedComplexity:
77
+ Max: 24
78
+
79
+ # Offense count: 1
80
+ # Configuration parameters: CountComments.
81
+ Metrics/ClassLength:
82
+ Max: 411
83
+
84
+ # TODO
85
+ # Offense count: 5
86
+ Style/ClassVars:
87
+ Enabled: false
88
+
89
+ # TODO
90
+ # Offense count: 5
91
+ # Cop supports --auto-correct.
92
+ # Configuration parameters: PreferredMethods.
93
+ Style/CollectionMethods:
94
+ Enabled: false
95
+
96
+ # TODO
97
+ # Offense count: 4
98
+ # Cop supports --auto-correct.
99
+ Style/ColonMethodCall:
100
+ Enabled: false
101
+
102
+ Style/ConditionalAssignment:
103
+ EnforcedStyle: assign_inside_condition
104
+
105
+ # Offense count: 2
106
+ Naming/ConstantName:
107
+ Enabled: false
108
+
109
+ # TODO: eh?
110
+ # Offense count: 4
111
+ Metrics/CyclomaticComplexity:
112
+ Max: 22
113
+
114
+ Style/PreferredHashMethods:
115
+ EnforcedStyle: verbose
116
+
117
+ # TODO: docs
118
+ # Offense count: 17
119
+ Style/Documentation:
120
+ Enabled: false
121
+
122
+ # Offense count: 9
123
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
124
+ Layout/DotPosition:
125
+ Enabled: false
126
+
127
+ # Offense count: 1
128
+ Style/DoubleNegation:
129
+ Enabled: false
130
+
131
+ # TODO
132
+ # Offense count: 2
133
+ Style/EachWithObject:
134
+ Enabled: false
135
+
136
+ # Offense count: 5
137
+ # Cop supports --auto-correct.
138
+ Layout/EmptyLines:
139
+ Enabled: false
140
+
141
+ # Offense count: 11
142
+ # Cop supports --auto-correct.
143
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
144
+ Layout/EmptyLinesAroundClassBody:
145
+ Enabled: false
146
+
147
+ # Offense count: 1
148
+ # Cop supports --auto-correct.
149
+ Layout/EmptyLinesAroundMethodBody:
150
+ Enabled: false
151
+
152
+ # Offense count: 9
153
+ # Cop supports --auto-correct.
154
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
155
+ Layout/EmptyLinesAroundModuleBody:
156
+ Enabled: false
157
+
158
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
159
+ Enabled: false
160
+
161
+ # Offense count: 31
162
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
163
+ Style/Encoding:
164
+ Enabled: false
165
+
166
+ Naming/FileName:
167
+ Exclude:
168
+ - lib/rest-client.rb
169
+
170
+ # Offense count: 3
171
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
172
+ Style/FormatString:
173
+ Enabled: false
174
+
175
+ # TODO: enable
176
+ # Cop supports --auto-correct.
177
+ # Configuration parameters: SupportedStyles.
178
+ Style/HashSyntax:
179
+ Enabled: false
180
+
181
+ # NOTABUG
182
+ # Offense count: 8
183
+ # Configuration parameters: MaxLineLength.
184
+ Style/IfUnlessModifier:
185
+ Enabled: false
186
+
187
+ Layout/IndentFirstHashElement:
188
+ Exclude:
189
+ - 'spec/**/*.rb'
190
+
191
+ # NOTABUG
192
+ # Offense count: 19
193
+ Style/Lambda:
194
+ Enabled: false
195
+
196
+ # TODO
197
+ # Offense count: 14
198
+ # Cop supports --auto-correct.
199
+ Layout/LeadingCommentSpace:
200
+ Enabled: false
201
+
202
+ Metrics/LineLength:
203
+ Exclude:
204
+ - 'spec/**/*.rb'
205
+ - 'Rakefile'
206
+
207
+ # TODO
208
+ # Offense count: 28
209
+ # Cop supports --auto-correct.
210
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
211
+ Style/MethodDefParentheses:
212
+ Enabled: false
213
+
214
+ # TODO
215
+ # Offense count: 1
216
+ Style/ModuleFunction:
217
+ Enabled: false
218
+
219
+ # Offense count: 4
220
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
221
+ Style/Next:
222
+ Enabled: false
223
+
224
+ # Offense count: 1
225
+ # Cop supports --auto-correct.
226
+ # Configuration parameters: IncludeSemanticChanges.
227
+ Style/NonNilCheck:
228
+ Enabled: false
229
+
230
+ # TODO: exclude
231
+ # Offense count: 1
232
+ # Cop supports --auto-correct.
233
+ Style/Not:
234
+ Enabled: false
235
+
236
+ # Offense count: 2
237
+ # Cop supports --auto-correct.
238
+ Style/NumericLiterals:
239
+ MinDigits: 11
240
+
241
+ # TODO?
242
+ # Offense count: 1
243
+ # Cop supports --auto-correct.
244
+ # Configuration parameters: AllowSafeAssignment.
245
+ Style/ParenthesesAroundCondition:
246
+ Enabled: false
247
+
248
+ # Offense count: 8
249
+ # Cop supports --auto-correct.
250
+ # Configuration parameters: PreferredDelimiters.
251
+ Style/PercentLiteralDelimiters:
252
+ PreferredDelimiters:
253
+ '%w': '{}'
254
+ '%W': '{}'
255
+ '%Q': '{}'
256
+ Exclude:
257
+ - 'bin/restclient'
258
+
259
+ # Offense count: 3
260
+ # Configuration parameters: NamePrefixBlacklist.
261
+ Naming/PredicateName:
262
+ Enabled: false
263
+
264
+ # TODO: configure
265
+ # Offense count: 3
266
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
267
+ Style/RaiseArgs:
268
+ Enabled: false
269
+
270
+ # TODO
271
+ # Offense count: 1
272
+ # Cop supports --auto-correct.
273
+ Style/RedundantBegin:
274
+ Enabled: false
275
+
276
+ # Offense count: 2
277
+ # Cop supports --auto-correct.
278
+ Style/RedundantSelf:
279
+ Enabled: false
280
+
281
+ # Offense count: 1
282
+ Style/RescueModifier:
283
+ Enabled: false
284
+ Exclude:
285
+ - 'bin/restclient'
286
+
287
+ # TODO: configure
288
+ # Offense count: 12
289
+ # Cop supports --auto-correct.
290
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
291
+ Style/SignalException:
292
+ Enabled: false
293
+
294
+ # TODO
295
+ # Offense count: 2
296
+ # Cop supports --auto-correct.
297
+ Layout/SpaceAfterNot:
298
+ Enabled: false
299
+
300
+ # Offense count: 19
301
+ # Cop supports --auto-correct.
302
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
303
+ Layout/SpaceAroundEqualsInParameterDefault:
304
+ Enabled: false
305
+
306
+ # Offense count: 20
307
+ # Cop supports --auto-correct.
308
+ Layout/SpaceAroundOperators:
309
+ Enabled: false
310
+
311
+ # Offense count: 9
312
+ # Cop supports --auto-correct.
313
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
314
+ Layout/SpaceBeforeBlockBraces:
315
+ Enabled: false
316
+
317
+ Layout/EmptyLinesAroundBlockBody:
318
+ Enabled: false
319
+
320
+ # Offense count: 37
321
+ # Cop supports --auto-correct.
322
+ # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
323
+ Layout/SpaceInsideBlockBraces:
324
+ Enabled: false
325
+
326
+ # Offense count: 181
327
+ # Cop supports --auto-correct.
328
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
329
+ Layout/SpaceInsideHashLiteralBraces:
330
+ Enabled: false
331
+
332
+ # TODO
333
+ # Offense count: 9
334
+ # Cop supports --auto-correct.
335
+ Layout/SpaceInsideParens:
336
+ Enabled: false
337
+
338
+ # Offense count: 414
339
+ # Cop supports --auto-correct.
340
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
341
+ Style/StringLiterals:
342
+ Enabled: false
343
+
344
+ Style/TrailingCommaInArrayLiteral:
345
+ EnforcedStyleForMultiline: consistent_comma
346
+ Style/TrailingCommaInHashLiteral:
347
+ EnforcedStyleForMultiline: consistent_comma
348
+ Style/TrailingCommaInArguments:
349
+ Enabled: false
350
+
351
+ # TODO: configure
352
+ # Offense count: 1
353
+ # Cop supports --auto-correct.
354
+ # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
355
+ Style/TrivialAccessors:
356
+ Enabled: false
357
+ Exclude: ['lib/restclient/payload.rb']
358
+
359
+ # TODO?
360
+ # Offense count: 3
361
+ Style/UnlessElse:
362
+ Enabled: false
363
+
364
+ # TODO?
365
+ # Offense count: 6
366
+ # Cop supports --auto-correct.
367
+ Style/UnneededPercentQ:
368
+ Enabled: false
369
+
370
+ # Offense count: 5
371
+ # Cop supports --auto-correct.
372
+ Style/WordArray:
373
+ MinSize: 4
374
+
375
+ # TODO?
376
+ # Offense count: 5
377
+ # Cop supports --auto-correct.
378
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
379
+ Style/BarePercentLiterals:
380
+ Enabled: false
381
+
382
+
383
+ Style/RescueStandardError:
384
+ Exclude:
385
+ - 'bin/restclient'
386
+ - 'lib/restclient/windows/root_certs.rb'
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ ---
2
+ inherit_from:
3
+ - .rubocop-disables.yml
4
+
5
+ AllCops:
6
+ Exclude:
7
+ - 'tmp/*.rb'
8
+ - 'vendor/**/*'
data/.travis.yml ADDED
@@ -0,0 +1,62 @@
1
+ # Available ruby versions: http://rubies.travis-ci.org/
2
+
3
+ language: ruby
4
+ sudo: false
5
+
6
+ os:
7
+ - linux
8
+ # - osx
9
+
10
+ rvm:
11
+ - "2.1" # latest 2.1.x
12
+ - "2.2.10"
13
+ - "2.3.8"
14
+ - "2.4.6"
15
+ - "2.5.5"
16
+ - "2.6.3"
17
+ - "ruby-head"
18
+ - "jruby-9.1.9.0"
19
+ - "jruby-head"
20
+
21
+ cache: bundler
22
+
23
+ script:
24
+ - bundle exec rake test
25
+ - bundle exec rake rubocop
26
+
27
+ branches:
28
+ except:
29
+ - "readme-edits"
30
+
31
+ before_install:
32
+ # Install rubygems < 3.0 so that we can support ruby < 2.3
33
+ # https://github.com/rubygems/rubygems/issues/2534
34
+ - gem install rubygems-update -v '<3' && update_rubygems
35
+ # bundler installation needed for jruby-head
36
+ # https://github.com/travis-ci/travis-ci/issues/5861
37
+ # stick to bundler 1.x in order to support ruby < 2.3
38
+ - gem install bundler -v '~> 1.17'
39
+
40
+ # Travis macOS support is pretty janky. These are some hacks to include tests
41
+ # only on versions that actually work. We test on macOS because Apple monkey
42
+ # patches OpenSSL to have different behavior, and we want to ensure that SSL
43
+ # verification at least is broken in the expected ways on macOS.
44
+ # (last tested: 2019-08)
45
+ matrix:
46
+ # exclude: {}
47
+ include:
48
+ # test only a few versions on mac
49
+ - os: osx
50
+ rvm: 2.6.3
51
+ - os: osx
52
+ rvm: ruby-head
53
+ - os: osx
54
+ rvm: jruby-9.1.9.0
55
+ - os: osx
56
+ rvm: jruby-head
57
+
58
+ allow_failures:
59
+ - rvm: 'ruby-head'
60
+
61
+ # return results as soon as mandatory versions are done
62
+ fast_finish: true