xsr 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/LICENSE +22 -0
  4. data/README.md +9 -4
  5. data/test/helper.rb +3 -5
  6. data/xsr.gemspec +4 -4
  7. metadata +20 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 174dc7e4fd5f56ecbebf9403d7322716cb33201f
4
- data.tar.gz: c0c1fbb19e00f5c746187c127706ce6b95eb846d
3
+ metadata.gz: 39ab889ea831529ef693fb4e8155a602fc967347
4
+ data.tar.gz: 197db55a65aa0f54fd1e8f4b0ef886d73c0ad902
5
5
  SHA512:
6
- metadata.gz: fa07c616864c1edaa29419bfa0b2fe8d35fa3bb44d1392f716cf6a44364e90e0e5b0894ff4b3a6c9d820e546dca2e053b1ee775d2a10e179c6ae2b3fad63ef8f
7
- data.tar.gz: 695e3f98d09f887908a1e84c7916ec5dbdc276b5f4b171d88007cba1269fc9c799cd7999cbed24d1522aeebd532d0fb90717fa040a92d19464bb7e0ca600bca8
6
+ metadata.gz: f3601a3830756dd838531c5d92f5291687c3cfd656efb281a58f490d4792114495d1a077bf2352209210fc69f21701587a099875b673e8bf67e7702d2463bff0
7
+ data.tar.gz: 87525098dbf9e68d27db92dc02d455f5ce7d58830a0741b65eddb2e92126630903ac22241bfb3e1f30e6a6b87332143402bf25f6255477691473202e7bacf3db
data/.travis.yml CHANGED
@@ -7,5 +7,6 @@ rvm:
7
7
  install:
8
8
  - gem install multi_json
9
9
  - gem install cutest -v 1.1.3
10
+ - gem install codeclimate-test-reporter
10
11
  script:
11
12
  RUBYLIB=./lib cutest test/*_test.rb
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Matias Owsianik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![Dependency Status](https://gemnasium.com/matiasow/xsr.svg)][gemnasium]
5
5
  [![Code Climate](https://codeclimate.com/github/matiasow/xsr/badges/gpa.svg)][codeclimate]
6
6
  [![Build Status](https://travis-ci.org/matiasow/xsr.svg?branch=master)][travis]
7
+ [![Test Coverage](https://codeclimate.com/github/matiasow/xsr/badges/coverage.svg)][codeclimate]
7
8
 
8
9
  [gem]: http://badge.fury.io/rb/xsr
9
10
  [gemnasium]: https://gemnasium.com/matiasow/xsr
@@ -43,7 +44,7 @@ And then invoke a service:
43
44
  resp = client.get('http://api.something.io')
44
45
  resp.success?
45
46
  #=> true
46
- resp.json_body
47
+ resp.body
47
48
  #=> JSON response as a Ruby Hash Object
48
49
  ```
49
50
  ###Supported HTTP verbs
@@ -104,13 +105,17 @@ resp.not_found?
104
105
  resp.server_error?
105
106
  #=> Response status code is 500
106
107
 
107
- resp.json_body
108
+ resp.body
108
109
  #=> JSON response as a Ruby Hash object
109
110
 
110
- resp.body
111
- #-> plain HTTP response string
111
+ resp.http_response
112
+ #-> Call http_response to get full Net::HTTPResponse object
112
113
  ```
113
114
 
114
115
  ##What's next?
115
116
  I'm not planning to add more features right now, but feel free to fork this repo and add any extra functionality you consider that should be included. Please, submit a PR with proposed changes or fixes.
116
117
  Just keep in mind a minimalist paradigm (https://youtu.be/tXVr2E1vfmk).
118
+
119
+ ##License
120
+
121
+ XSR is released under the [MIT License](http://www.opensource.org/licenses/MIT).
data/test/helper.rb CHANGED
@@ -1,6 +1,4 @@
1
- require 'securerandom'
2
-
3
- def random_hash
4
- {SecureRandom.hex => SecureRandom.hex}
1
+ if ENV["TRAVIS"]
2
+ require "codeclimate-test-reporter"
3
+ CodeClimate::TestReporter.start
5
4
  end
6
-
data/xsr.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'xsr'
3
- s.version = '1.2.0'
3
+ s.version = '1.2.2'
4
4
  s.summary = "XSR: eXtremely Simple REST Client"
5
5
  s.description = "A very simple library to talk to a REST/JSON API"
6
- s.authors = ["Matias Owsianik"]
6
+ s.authors = ["matiasow"]
7
7
  s.email = ['matiasow@gmail.com']
8
8
  s.homepage = 'http://github.com/matiasow/xsr'
9
9
  s.license = 'MIT'
10
10
 
11
11
  s.files = `git ls-files`.split("\n")
12
12
 
13
- s.add_dependency "multi_json"
14
- s.add_development_dependency "cutest"
13
+ s.add_dependency "multi_json", '~> 1.11', '>= 1.11.0'
14
+ s.add_development_dependency "cutest", '~> 1.2', '>= 1.2.2'
15
15
  end
metadata CHANGED
@@ -1,43 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
- - Matias Owsianik
7
+ - matiasow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-16 00:00:00.000000000 Z
11
+ date: 2015-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: '0'
22
+ version: 1.11.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.11'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '0'
32
+ version: 1.11.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: cutest
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.2'
31
40
  - - ">="
32
41
  - !ruby/object:Gem::Version
33
- version: '0'
42
+ version: 1.2.2
34
43
  type: :development
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.2'
38
50
  - - ">="
39
51
  - !ruby/object:Gem::Version
40
- version: '0'
52
+ version: 1.2.2
41
53
  description: A very simple library to talk to a REST/JSON API
42
54
  email:
43
55
  - matiasow@gmail.com
@@ -47,6 +59,7 @@ extra_rdoc_files: []
47
59
  files:
48
60
  - ".gitignore"
49
61
  - ".travis.yml"
62
+ - LICENSE
50
63
  - README.md
51
64
  - lib/xsr.rb
52
65
  - lib/xsr/client.rb