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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +8 -0
- data/lib/nds_api/http.rb +8 -8
- data/lib/nds_api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74a51ed4639bd18abf242c7f5c0d76b61dcb7fe2051e51aa6bd7b8914af2972d
|
4
|
+
data.tar.gz: 15b855a1e7601e67814cdc48f585e923eecc0e65c8518fce695efa767da452ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5facb03788dbadd423440d14f509f1bc4c2f0a7d6ddd099a06a05cc1d4805829ddd8975ac1a8698fefd6062e9662382f2db5c5b63409361122f43966a20aebbe
|
7
|
+
data.tar.gz: 4e17dc30ee815093201d9c17919c0970c38032475592da3e381a99665117c20e29df3d2192c272213588cd0cc658a3facb8b48821891e032ad155effde2c8ad9
|
data/Gemfile.lock
CHANGED
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 =>
|
15
|
-
puts "NDS API
|
16
|
-
|
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 =>
|
41
|
-
puts "NDS API
|
42
|
-
|
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 ==
|
47
|
-
return Net::HTTP::Put if post_or_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
|
data/lib/nds_api/version.rb
CHANGED
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.
|
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-
|
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.
|
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/
|