rest-client 2.0.2-x86-mingw32 → 2.1.0.rc1-x86-mingw32
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: x86-mingw32
         
     | 
| 
       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
         
     | 
| 
         @@ -179,7 +199,9 @@ extra_rdoc_files: 
     | 
|
| 
       179 
199 
     | 
    
         
             
            - history.md
         
     | 
| 
       180 
200 
     | 
    
         
             
            files:
         
     | 
| 
       181 
201 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
      
 202 
     | 
    
         
            +
            - ".mailmap"
         
     | 
| 
       182 
203 
     | 
    
         
             
            - ".rspec"
         
     | 
| 
      
 204 
     | 
    
         
            +
            - ".rubocop"
         
     | 
| 
       183 
205 
     | 
    
         
             
            - ".rubocop-disables.yml"
         
     | 
| 
       184 
206 
     | 
    
         
             
            - ".rubocop.yml"
         
     | 
| 
       185 
207 
     | 
    
         
             
            - ".travis.yml"
         
     | 
| 
         @@ -208,6 +230,7 @@ files: 
     | 
|
| 
       208 
230 
     | 
    
         
             
            - lib/restclient/windows/root_certs.rb
         
     | 
| 
       209 
231 
     | 
    
         
             
            - rest-client.gemspec
         
     | 
| 
       210 
232 
     | 
    
         
             
            - rest-client.windows.gemspec
         
     | 
| 
      
 233 
     | 
    
         
            +
            - spec/ISS.jpg
         
     | 
| 
       211 
234 
     | 
    
         
             
            - spec/helpers.rb
         
     | 
| 
       212 
235 
     | 
    
         
             
            - spec/integration/_lib.rb
         
     | 
| 
       213 
236 
     | 
    
         
             
            - spec/integration/capath_digicert/244b5494.0
         
     | 
| 
         @@ -227,7 +250,6 @@ files: 
     | 
|
| 
       227 
250 
     | 
    
         
             
            - spec/unit/_lib.rb
         
     | 
| 
       228 
251 
     | 
    
         
             
            - spec/unit/abstract_response_spec.rb
         
     | 
| 
       229 
252 
     | 
    
         
             
            - spec/unit/exceptions_spec.rb
         
     | 
| 
       230 
     | 
    
         
            -
            - spec/unit/master_shake.jpg
         
     | 
| 
       231 
253 
     | 
    
         
             
            - spec/unit/params_array_spec.rb
         
     | 
| 
       232 
254 
     | 
    
         
             
            - spec/unit/payload_spec.rb
         
     | 
| 
       233 
255 
     | 
    
         
             
            - spec/unit/raw_response_spec.rb
         
     | 
| 
         @@ -253,17 +275,18 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       253 
275 
     | 
    
         
             
                  version: 2.0.0
         
     | 
| 
       254 
276 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       255 
277 
     | 
    
         
             
              requirements:
         
     | 
| 
       256 
     | 
    
         
            -
              - - " 
     | 
| 
      
 278 
     | 
    
         
            +
              - - ">"
         
     | 
| 
       257 
279 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       258 
     | 
    
         
            -
                  version:  
     | 
| 
      
 280 
     | 
    
         
            +
                  version: 1.3.1
         
     | 
| 
       259 
281 
     | 
    
         
             
            requirements: []
         
     | 
| 
       260 
282 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       261 
     | 
    
         
            -
            rubygems_version: 2.6. 
     | 
| 
      
 283 
     | 
    
         
            +
            rubygems_version: 2.6.12
         
     | 
| 
       262 
284 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       263 
285 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       264 
286 
     | 
    
         
             
            summary: Simple HTTP and REST client for Ruby, inspired by microframework syntax for
         
     | 
| 
       265 
287 
     | 
    
         
             
              specifying actions.
         
     | 
| 
       266 
288 
     | 
    
         
             
            test_files:
         
     | 
| 
      
 289 
     | 
    
         
            +
            - spec/ISS.jpg
         
     | 
| 
       267 
290 
     | 
    
         
             
            - spec/helpers.rb
         
     | 
| 
       268 
291 
     | 
    
         
             
            - spec/integration/_lib.rb
         
     | 
| 
       269 
292 
     | 
    
         
             
            - spec/integration/capath_digicert/244b5494.0
         
     | 
| 
         @@ -283,7 +306,6 @@ test_files: 
     | 
|
| 
       283 
306 
     | 
    
         
             
            - spec/unit/_lib.rb
         
     | 
| 
       284 
307 
     | 
    
         
             
            - spec/unit/abstract_response_spec.rb
         
     | 
| 
       285 
308 
     | 
    
         
             
            - spec/unit/exceptions_spec.rb
         
     | 
| 
       286 
     | 
    
         
            -
            - spec/unit/master_shake.jpg
         
     | 
| 
       287 
309 
     | 
    
         
             
            - spec/unit/params_array_spec.rb
         
     | 
| 
       288 
310 
     | 
    
         
             
            - spec/unit/payload_spec.rb
         
     | 
| 
       289 
311 
     | 
    
         
             
            - spec/unit/raw_response_spec.rb
         
     | 
    
        data/spec/unit/master_shake.jpg
    DELETED
    
    | 
         Binary file 
     |