rest-client 1.6.14 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +6 -6
  3. data/.rspec +2 -1
  4. data/.rubocop-disables.yml +384 -0
  5. data/.rubocop.yml +3 -0
  6. data/.travis.yml +46 -1
  7. data/AUTHORS +28 -5
  8. data/Gemfile +5 -1
  9. data/LICENSE +21 -0
  10. data/README.md +784 -0
  11. data/Rakefile +95 -12
  12. data/bin/restclient +11 -12
  13. data/history.md +180 -16
  14. data/lib/restclient.rb +25 -11
  15. data/lib/restclient/abstract_response.rb +171 -51
  16. data/lib/restclient/exceptions.rb +102 -56
  17. data/lib/restclient/params_array.rb +72 -0
  18. data/lib/restclient/payload.rb +43 -74
  19. data/lib/restclient/platform.rb +22 -2
  20. data/lib/restclient/raw_response.rb +7 -3
  21. data/lib/restclient/request.rb +672 -179
  22. data/lib/restclient/resource.rb +6 -7
  23. data/lib/restclient/response.rb +64 -10
  24. data/lib/restclient/utils.rb +235 -0
  25. data/lib/restclient/version.rb +2 -1
  26. data/lib/restclient/windows.rb +8 -0
  27. data/lib/restclient/windows/root_certs.rb +105 -0
  28. data/rest-client.gemspec +16 -11
  29. data/rest-client.windows.gemspec +19 -0
  30. data/spec/helpers.rb +22 -0
  31. data/spec/integration/_lib.rb +1 -0
  32. data/spec/integration/capath_verisign/415660c1.0 +14 -0
  33. data/spec/integration/capath_verisign/7651b327.0 +14 -0
  34. data/spec/integration/capath_verisign/README +8 -0
  35. data/spec/integration/capath_verisign/verisign.crt +14 -0
  36. data/spec/integration/httpbin_spec.rb +87 -0
  37. data/spec/integration/integration_spec.rb +125 -0
  38. data/spec/integration/request_spec.rb +72 -20
  39. data/spec/spec_helper.rb +29 -0
  40. data/spec/unit/_lib.rb +1 -0
  41. data/spec/unit/abstract_response_spec.rb +145 -0
  42. data/spec/unit/exceptions_spec.rb +108 -0
  43. data/spec/{master_shake.jpg → unit/master_shake.jpg} +0 -0
  44. data/spec/unit/params_array_spec.rb +36 -0
  45. data/spec/{payload_spec.rb → unit/payload_spec.rb} +73 -54
  46. data/spec/{raw_response_spec.rb → unit/raw_response_spec.rb} +5 -4
  47. data/spec/unit/request2_spec.rb +54 -0
  48. data/spec/unit/request_spec.rb +1250 -0
  49. data/spec/unit/resource_spec.rb +134 -0
  50. data/spec/unit/response_spec.rb +241 -0
  51. data/spec/unit/restclient_spec.rb +79 -0
  52. data/spec/unit/utils_spec.rb +147 -0
  53. data/spec/unit/windows/root_certs_spec.rb +22 -0
  54. metadata +143 -53
  55. data/README.rdoc +0 -300
  56. data/lib/restclient/net_http_ext.rb +0 -55
  57. data/spec/abstract_response_spec.rb +0 -85
  58. data/spec/base.rb +0 -13
  59. data/spec/exceptions_spec.rb +0 -98
  60. data/spec/integration_spec.rb +0 -38
  61. data/spec/request2_spec.rb +0 -35
  62. data/spec/request_spec.rb +0 -528
  63. data/spec/resource_spec.rb +0 -136
  64. data/spec/response_spec.rb +0 -169
  65. data/spec/restclient_spec.rb +0 -73
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 317f1bdcf77b2dae0fe9a08a165a56c71fb9c3d79b71c8d6c5a12cb1e4868a4e
4
- data.tar.gz: d2a662189817597ff1fca0e6685cdd5d06bdac1ca72bf9a932f1d7def456b26b
2
+ SHA1:
3
+ metadata.gz: 10312217af6f5a0312bdce748c8fd82f428fce64
4
+ data.tar.gz: 67846732a7926b335a7082eb1fba0b7178f0c5c4
5
5
  SHA512:
6
- metadata.gz: f789e7291285e26aa719119331d0d1a6322ec618a25eb2626a1a8486e3584fb07e52d25dfb7a56972cb495e5e2cad6c67eae5f3da98d66974d51f3c4fc2566f1
7
- data.tar.gz: cf43508dbbc1f6977b3e8ad047651591760b8f386e3daa472888fc81f262b3d2669798f847b88fdd7b6f6f77b2a44990688c88efc53e02072bb9f284459c6b41
6
+ metadata.gz: 56d9d3140ee5418e9b4e877e9756bbb1a1858314c4487b5d7e41ca5fc72f70532f764dcf480c8c3098f4297025fa66c7d8db0bd890e9ae46459e7478a34a685a
7
+ data.tar.gz: 812f11c8a6c2c4ac5ec68852e75f64ae2d7416ae4683f5ff6525055dbf8e472baed3cc01a85eb76e5da2cb39233ff2dc2129cbdab7165dec89637987b346359b
data/.gitignore CHANGED
@@ -1,8 +1,8 @@
1
- .idea
2
- .rvmrc
3
- doc
4
- rdoc
5
- pkg
6
1
  *.gem
7
- scratchpad.rb
8
2
  /Gemfile.lock
3
+ /.bundle
4
+ /vendor
5
+ /doc
6
+ /pkg
7
+ /rdoc
8
+ /.yardoc
data/.rspec CHANGED
@@ -1 +1,2 @@
1
- --colour --format progress --order random
1
+ --color
2
+ --format progress
@@ -0,0 +1,384 @@
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
+ Lint/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
+ Style/ClassAndModuleCamelCase:
57
+ Enabled: false
58
+
59
+ # Offense count: 2
60
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
61
+ Style/ClassAndModuleChildren:
62
+ Enabled: false
63
+
64
+ # TODO?
65
+ # Offense count: 14
66
+ Metrics/AbcSize:
67
+ Max: 75
68
+
69
+ # TODO?
70
+ Metrics/MethodLength:
71
+ Max: 66
72
+
73
+ # TODO?
74
+ # Offense count: 4
75
+ Metrics/PerceivedComplexity:
76
+ Max: 24
77
+
78
+ # Offense count: 1
79
+ # Configuration parameters: CountComments.
80
+ Metrics/ClassLength:
81
+ Max: 411
82
+
83
+ # TODO
84
+ # Offense count: 5
85
+ Style/ClassVars:
86
+ Enabled: false
87
+
88
+ # TODO
89
+ # Offense count: 5
90
+ # Cop supports --auto-correct.
91
+ # Configuration parameters: PreferredMethods.
92
+ Style/CollectionMethods:
93
+ Enabled: false
94
+
95
+ # TODO
96
+ # Offense count: 4
97
+ # Cop supports --auto-correct.
98
+ Style/ColonMethodCall:
99
+ Enabled: false
100
+
101
+ Style/ConditionalAssignment:
102
+ EnforcedStyle: assign_inside_condition
103
+
104
+ # Offense count: 2
105
+ Style/ConstantName:
106
+ Enabled: false
107
+
108
+ # TODO: eh?
109
+ # Offense count: 4
110
+ Metrics/CyclomaticComplexity:
111
+ Max: 22
112
+
113
+ # Offense count: 1
114
+ # Cop supports --auto-correct.
115
+ Style/DeprecatedHashMethods:
116
+ Enabled: false
117
+
118
+ # TODO: docs
119
+ # Offense count: 17
120
+ Style/Documentation:
121
+ Enabled: false
122
+
123
+ # Offense count: 9
124
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
125
+ Style/DotPosition:
126
+ Enabled: false
127
+
128
+ # Offense count: 1
129
+ Style/DoubleNegation:
130
+ Enabled: false
131
+
132
+ # TODO
133
+ # Offense count: 2
134
+ Style/EachWithObject:
135
+ Enabled: false
136
+
137
+ # Offense count: 5
138
+ # Cop supports --auto-correct.
139
+ Style/EmptyLines:
140
+ Enabled: false
141
+
142
+ # Offense count: 11
143
+ # Cop supports --auto-correct.
144
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
145
+ Style/EmptyLinesAroundClassBody:
146
+ Enabled: false
147
+
148
+ # Offense count: 1
149
+ # Cop supports --auto-correct.
150
+ Style/EmptyLinesAroundMethodBody:
151
+ Enabled: false
152
+
153
+ # Offense count: 9
154
+ # Cop supports --auto-correct.
155
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
156
+ Style/EmptyLinesAroundModuleBody:
157
+ Enabled: false
158
+
159
+ # Offense count: 31
160
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
161
+ Style/Encoding:
162
+ Enabled: false
163
+
164
+ # TODO: exclude
165
+ # Offense count: 1
166
+ # Configuration parameters: Exclude.
167
+ Style/FileName:
168
+ Enabled: false
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
+ # TODO: configure
188
+ # Offense count: 6
189
+ # Cop supports --auto-correct.
190
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
191
+ Style/IndentHash:
192
+ Enabled: false
193
+
194
+ # NOTABUG
195
+ # Offense count: 19
196
+ Style/Lambda:
197
+ Enabled: false
198
+
199
+ # TODO
200
+ # Offense count: 14
201
+ # Cop supports --auto-correct.
202
+ Style/LeadingCommentSpace:
203
+ Enabled: false
204
+
205
+ # TODO
206
+ # Offense count: 218
207
+ # Configuration parameters: AllowURI.
208
+ Metrics/LineLength:
209
+ Max: 340
210
+
211
+ # TODO
212
+ # Offense count: 28
213
+ # Cop supports --auto-correct.
214
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
215
+ Style/MethodDefParentheses:
216
+ Enabled: false
217
+
218
+ # TODO
219
+ # Offense count: 1
220
+ Style/ModuleFunction:
221
+ Enabled: false
222
+
223
+ # Offense count: 4
224
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
225
+ Style/Next:
226
+ Enabled: false
227
+
228
+ # Offense count: 1
229
+ # Cop supports --auto-correct.
230
+ # Configuration parameters: IncludeSemanticChanges.
231
+ Style/NonNilCheck:
232
+ Enabled: false
233
+
234
+ # TODO: exclude
235
+ # Offense count: 1
236
+ # Cop supports --auto-correct.
237
+ Style/Not:
238
+ Enabled: false
239
+
240
+ # Offense count: 2
241
+ # Cop supports --auto-correct.
242
+ Style/NumericLiterals:
243
+ MinDigits: 11
244
+
245
+ # TODO?
246
+ # Offense count: 1
247
+ # Cop supports --auto-correct.
248
+ # Configuration parameters: AllowSafeAssignment.
249
+ Style/ParenthesesAroundCondition:
250
+ Enabled: false
251
+
252
+ # Offense count: 8
253
+ # Cop supports --auto-correct.
254
+ # Configuration parameters: PreferredDelimiters.
255
+ Style/PercentLiteralDelimiters:
256
+ PreferredDelimiters:
257
+ '%w': '{}'
258
+ '%W': '{}'
259
+ '%Q': '{}'
260
+ Exclude:
261
+ - 'bin/restclient'
262
+
263
+ # Offense count: 3
264
+ # Configuration parameters: NamePrefixBlacklist.
265
+ Style/PredicateName:
266
+ Enabled: false
267
+
268
+ # TODO: configure
269
+ # Offense count: 3
270
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
271
+ Style/RaiseArgs:
272
+ Enabled: false
273
+
274
+ # TODO
275
+ # Offense count: 1
276
+ # Cop supports --auto-correct.
277
+ Style/RedundantBegin:
278
+ Enabled: false
279
+
280
+ # Offense count: 2
281
+ # Cop supports --auto-correct.
282
+ Style/RedundantSelf:
283
+ Enabled: false
284
+
285
+ # Offense count: 1
286
+ Style/RescueModifier:
287
+ Enabled: false
288
+ Exclude:
289
+ - 'bin/restclient'
290
+
291
+ # TODO: configure
292
+ # Offense count: 12
293
+ # Cop supports --auto-correct.
294
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
295
+ Style/SignalException:
296
+ Enabled: false
297
+
298
+ # TODO
299
+ # Offense count: 2
300
+ # Cop supports --auto-correct.
301
+ Style/SpaceAfterNot:
302
+ Enabled: false
303
+
304
+ # Offense count: 19
305
+ # Cop supports --auto-correct.
306
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
307
+ Style/SpaceAroundEqualsInParameterDefault:
308
+ Enabled: false
309
+
310
+ # Offense count: 20
311
+ # Cop supports --auto-correct.
312
+ Style/SpaceAroundOperators:
313
+ Enabled: false
314
+
315
+ # Offense count: 9
316
+ # Cop supports --auto-correct.
317
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
318
+ Style/SpaceBeforeBlockBraces:
319
+ Enabled: false
320
+
321
+ # Offense count: 37
322
+ # Cop supports --auto-correct.
323
+ # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
324
+ Style/SpaceInsideBlockBraces:
325
+ Enabled: false
326
+
327
+ # Offense count: 6
328
+ # Cop supports --auto-correct.
329
+ Style/SpaceInsideBrackets:
330
+ Enabled: false
331
+
332
+ # Offense count: 181
333
+ # Cop supports --auto-correct.
334
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
335
+ Style/SpaceInsideHashLiteralBraces:
336
+ Enabled: false
337
+
338
+ # TODO
339
+ # Offense count: 9
340
+ # Cop supports --auto-correct.
341
+ Style/SpaceInsideParens:
342
+ Enabled: false
343
+
344
+ # Offense count: 414
345
+ # Cop supports --auto-correct.
346
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
347
+ Style/StringLiterals:
348
+ Enabled: false
349
+
350
+ Style/TrailingCommaInLiteral:
351
+ EnforcedStyleForMultiline: comma
352
+ Style/TrailingCommaInArguments:
353
+ Enabled: false
354
+
355
+ # TODO: configure
356
+ # Offense count: 1
357
+ # Cop supports --auto-correct.
358
+ # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
359
+ Style/TrivialAccessors:
360
+ Enabled: false
361
+ Exclude: ['lib/restclient/payload.rb']
362
+
363
+ # TODO?
364
+ # Offense count: 3
365
+ Style/UnlessElse:
366
+ Enabled: false
367
+
368
+ # TODO?
369
+ # Offense count: 6
370
+ # Cop supports --auto-correct.
371
+ Style/UnneededPercentQ:
372
+ Enabled: false
373
+
374
+ # Offense count: 5
375
+ # Cop supports --auto-correct.
376
+ Style/WordArray:
377
+ MinSize: 4
378
+
379
+ # TODO?
380
+ # Offense count: 5
381
+ # Cop supports --auto-correct.
382
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
383
+ Style/BarePercentLiterals:
384
+ Enabled: false
@@ -0,0 +1,3 @@
1
+ ---
2
+ inherit_from:
3
+ - .rubocop-disables.yml
@@ -1,3 +1,48 @@
1
+ # Available ruby versions: http://rubies.travis-ci.org/
2
+
1
3
  language: ruby
4
+
5
+ os:
6
+ - linux
7
+ - osx
8
+
2
9
  rvm:
3
- - "1.8.7"
10
+ - "2.0.0"
11
+ - "2.1" # latest 2.1.x
12
+ - "2.2.5"
13
+ - "2.3.3"
14
+ - "2.4.0"
15
+ - "ruby-head"
16
+ - "jruby-9.0.5.0"
17
+ - "jruby-9.1.5.0"
18
+ - "jruby-head"
19
+
20
+ cache: bundler
21
+
22
+ script:
23
+ bundle exec rake test
24
+
25
+ branches:
26
+ except:
27
+ - "readme-edits"
28
+
29
+ before_install:
30
+ - gem update --system
31
+ # bundler installation needed for jruby-head
32
+ # https://github.com/travis-ci/travis-ci/issues/5861
33
+ - gem install bundler
34
+
35
+ # Travis OS X support is pretty janky. These are some hacks to include tests
36
+ # only on versions that actually work.
37
+ # (last tested: 2016-11)
38
+ matrix:
39
+ # exclude: {}
40
+ # include: {}
41
+
42
+ allow_failures:
43
+ - rvm: 'ruby-head'
44
+
45
+ # return results as soon as mandatory versions are done
46
+ fast_finish: true
47
+
48
+ sudo: false