oreilly_api 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec_status +6 -6
- data/Gemfile.lock +1 -1
- data/Rakefile +4 -0
- data/lib/oreilly_api/version.rb +1 -1
- data/lib/oreilly_api.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb1943971c134c0817a0a6d0cebf7a960e8d450376a11be451910bb3c28bb28
|
4
|
+
data.tar.gz: 1cd243dceb0ceab65ac9e6f16cd6e8e4da0002b7849911f3c14280d2db0b2492
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cf84a0a7f5824f5043d6f0f3b292cfd46d5f9786e498d033510d0ca3c2c12b19f76d3c1821c8d42c79746e565f26b99e84f06b382d7c1ed22540830ea0aa20d
|
7
|
+
data.tar.gz: 8105641fa782d036e1ebb565a6418147a8ab11f5a02c3367988d5e5705df67b77aca715dfd7d8e0c85be49b44646c085e606864ab402607e4af4e003ddaf0a6e
|
data/.rspec_status
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------- | ------- | --------------- |
|
3
|
-
./spec/oreilly_api_spec.rb[1:1] | passed | 0.
|
4
|
-
./spec/oreilly_api_spec.rb[1:2] | passed | 0.
|
5
|
-
./spec/oreilly_api_spec.rb[1:3] | passed | 0.
|
6
|
-
./spec/oreilly_api_spec.rb[1:4] | pending | 0.
|
7
|
-
./spec/oreilly_api_spec.rb[1:5] | passed | 0.
|
8
|
-
./spec/oreilly_api_spec.rb[1:6] | passed | 0.
|
3
|
+
./spec/oreilly_api_spec.rb[1:1] | passed | 0.00312 seconds |
|
4
|
+
./spec/oreilly_api_spec.rb[1:2] | passed | 0.03616 seconds |
|
5
|
+
./spec/oreilly_api_spec.rb[1:3] | passed | 0.01192 seconds |
|
6
|
+
./spec/oreilly_api_spec.rb[1:4] | pending | 0.00002 seconds |
|
7
|
+
./spec/oreilly_api_spec.rb[1:5] | passed | 0.01359 seconds |
|
8
|
+
./spec/oreilly_api_spec.rb[1:6] | passed | 0.01565 seconds |
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
data/lib/oreilly_api/version.rb
CHANGED
data/lib/oreilly_api.rb
CHANGED
@@ -8,12 +8,13 @@ require 'redis'
|
|
8
8
|
require 'redis_utility'
|
9
9
|
|
10
10
|
# rubocop:disable Metrics/MethodLength
|
11
|
+
# rubocop:disable Layout/LineLength
|
11
12
|
|
12
13
|
# OreillyApi
|
13
14
|
module OreillyApi
|
14
15
|
TOKEN = 'oreilly_api_token'
|
15
16
|
class << self
|
16
|
-
attr_accessor :domain, :version, :client_id, :client_secret, :identity, :account_number
|
17
|
+
attr_accessor :domain, :version, :client_id, :client_secret, :identity, :account_number, :device_id
|
17
18
|
|
18
19
|
def config
|
19
20
|
yield self
|
@@ -105,7 +106,7 @@ module OreillyApi
|
|
105
106
|
}.to_json
|
106
107
|
|
107
108
|
params = "&client_id=#{OreillyApi.client_id}&client_secret=#{OreillyApi.client_secret}"
|
108
|
-
url = "#{OreillyApi.domain}/oauth-server/oauth/token?grant_type=client_credentials&device_id
|
109
|
+
url = "#{OreillyApi.domain}/oauth-server/oauth/token?grant_type=client_credentials&device_id=#{OreillyApi.device_id}#{params}"
|
109
110
|
res = RestClient.post(url, payload, { 'Content-Type' => 'application/json' })
|
110
111
|
token_info = JSON.parse(res)
|
111
112
|
@token = token_info['access_token']
|
@@ -122,4 +123,5 @@ module OreillyApi
|
|
122
123
|
end
|
123
124
|
end
|
124
125
|
# rubocop:enable Metrics/MethodLength
|
126
|
+
# rubocop:enable Layout/LineLength
|
125
127
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oreilly_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TruptiHosmani
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|