nds_api 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdb61bdf9314d6246c93a4d2fbc8f0b052ee63c4d916b1b83ae07f28e72252cd
4
- data.tar.gz: b223c535b4b983789dfd97962f14dd2b759ae0c921279edf70aa933a4bb6eca8
3
+ metadata.gz: 74a51ed4639bd18abf242c7f5c0d76b61dcb7fe2051e51aa6bd7b8914af2972d
4
+ data.tar.gz: 15b855a1e7601e67814cdc48f585e923eecc0e65c8518fce695efa767da452ed
5
5
  SHA512:
6
- metadata.gz: e4a228f8de7366b66b06f08483ebcde3d7cfcd131d55e225c5dcb823a0517ea0571136cd2194839e0fa36a9d1dfdc7e4d7472ef88f4d466d406d46e9694bb5b3
7
- data.tar.gz: 1d3e70d02ccccb3f4715b89e927bc6e71186d312add7d899be3d7c58449b55f3b60db608aef6c2349f001b2b1cb01dc29b86b4ae0258e3b9d5d6dbfc51b88502
6
+ metadata.gz: 5facb03788dbadd423440d14f509f1bc4c2f0a7d6ddd099a06a05cc1d4805829ddd8975ac1a8698fefd6062e9662382f2db5c5b63409361122f43966a20aebbe
7
+ data.tar.gz: 4e17dc30ee815093201d9c17919c0970c38032475592da3e381a99665117c20e29df3d2192c272213588cd0cc658a3facb8b48821891e032ad155effde2c8ad9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nds_api (0.1.8)
4
+ nds_api (0.1.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -17,4 +17,4 @@ DEPENDENCIES
17
17
  rake (~> 12.0)
18
18
 
19
19
  BUNDLED WITH
20
- 1.16.1
20
+ 1.16.2
data/README.md CHANGED
@@ -137,6 +137,14 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
137
137
 
138
138
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
139
139
 
140
+ Test GEM
141
+
142
+ `bin/console`
143
+
144
+ ```ruby
145
+ NdsApi::Client.new(agency_key: 00000, user: 'user', password: 'password', dev: true).provider_by_id(1234)
146
+ ```
147
+
140
148
  ## Publication
141
149
 
142
150
  `bundle exec rake release`
data/lib/nds_api/http.rb CHANGED
@@ -11,9 +11,9 @@ module NdsApi
11
11
 
12
12
  def get(url)
13
13
  JSON.parse(open(url, http_basic_authentication: [api_user, api_password]).read)
14
- rescue => e
15
- puts "NDS API GEM: #{e} (#{url})"
16
- return e
14
+ rescue StandardError => error
15
+ puts "NDS API ERROR: #{error} (GET:#{url})"
16
+ raise error
17
17
  end
18
18
 
19
19
  def post(url, data)
@@ -37,14 +37,14 @@ module NdsApi
37
37
  req.body = data.to_json
38
38
  response = Net::HTTP.new(url.host, url.port).request(req)
39
39
  JSON.parse(response.body)
40
- rescue => e
41
- puts "NDS API GEM: #{e} (#{post_or_put}:#{url})"
42
- return e
40
+ rescue StandardError => error
41
+ puts "NDS API ERROR: #{error} (#{post_or_put}:#{url})"
42
+ raise e
43
43
  end
44
44
 
45
45
  def http_verb_object(post_or_put)
46
- return Net::HTTP::Post if post_or_put == "post"
47
- return Net::HTTP::Put if post_or_put == "put"
46
+ return Net::HTTP::Post if post_or_put == 'post'
47
+ return Net::HTTP::Put if post_or_put == 'put'
48
48
  end
49
49
 
50
50
  def api_user
@@ -1,3 +1,3 @@
1
1
  module NdsApi
2
- VERSION = "0.1.8"
2
+ VERSION = '0.1.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nds_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Hunault
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-20 00:00:00.000000000 Z
11
+ date: 2018-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.7.6
88
+ rubygems_version: 2.7.7
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: NDS API is a Rubygem for easy interface with the NDS API. https://developer.uatup.naccrraware.net/