timedoctor 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/console +11 -7
- data/lib/timedoctor/token.rb +2 -0
- data/lib/timedoctor/worker.rb +1 -2
- data/lib/version.rb +1 -1
- 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: 33918c2259c31cc6f11abb684362dcae5b969fcd0c3b198f093572e790792ea6
|
4
|
+
data.tar.gz: 8dcf9a6c665d9c8481d980496fdb7d53bb8914a001a56862013b82ca9af668f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a15ae306835747cadf1af29c88c7d81a0aecc94e85c20fb49a78ce06982668b520d766b92930f7b81cc18cbb4ea70c8dd3b1de7a5279e9704a6aafb83f6e87
|
7
|
+
data.tar.gz: 6f16bed4f4dcfc6815b50ecaf631deb178eb4772a9845c08f8e4db5f62aa8f9929de613d9a8c5579cb0eaa1f401aa55c242558615061f84fd377158cb13736ef
|
data/Gemfile.lock
CHANGED
data/bin/console
CHANGED
@@ -19,10 +19,12 @@ config = {
|
|
19
19
|
|
20
20
|
# access_token:
|
21
21
|
# "Y2ZkMGY5OTA1NGI3NmJjZTZlYWJlYjczNGM4N2E2NTYwZjFmNzhjZGVhMGY3ZmU0MTIyZjQ5NTNkOGIzYWI3ZA",
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
access_token:
|
23
|
+
"Y2ZkMGY5OTA1NGI3NmJjZTZlYWJlYjczNGM4N2E2NTYwZjFmNzhjZGVhMGY3ZmU0MTIyZjQ5NTNkOGIzYWI3ZA",
|
24
|
+
refresh_token:
|
25
|
+
"ZmM3OTg1NjZmYjgwYmZlYzM2NzAwMjFlZmFhZmU4MDk1Y2ZhZWNlYjMyYTg0NzlmMzRmNzBiOWM5NTUxNjY4MA",
|
26
|
+
user_id: 1188995,
|
27
|
+
company_id: 587525,
|
26
28
|
|
27
29
|
# on_token_refresh: ->(data, conf) do
|
28
30
|
# p 'SUCCESS'
|
@@ -34,11 +36,13 @@ config = {
|
|
34
36
|
# end,
|
35
37
|
#
|
36
38
|
# on_token_refresh_error: ->(data, conf) { p "FAILURE" }
|
37
|
-
on_token_authorize_error: ->(data, conf) { p "FAILURE" }
|
39
|
+
# on_token_authorize_error: ->(data, conf) { p "FAILURE" }
|
38
40
|
}
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
+
|
43
|
+
|
44
|
+
# TimeDoctor::Auth.new(config).fetch_token
|
45
|
+
p TimeDoctor::Client.new(config).companies.list
|
42
46
|
#
|
43
47
|
# # p client.companies.list
|
44
48
|
#
|
data/lib/timedoctor/token.rb
CHANGED
@@ -27,6 +27,7 @@ module TimeDoctor
|
|
27
27
|
data
|
28
28
|
when 400
|
29
29
|
config[:on_token_authorize_error].call(data, config)
|
30
|
+
nil
|
30
31
|
else
|
31
32
|
raise UnknownError, response
|
32
33
|
end
|
@@ -50,6 +51,7 @@ module TimeDoctor
|
|
50
51
|
data
|
51
52
|
when 400
|
52
53
|
config[:on_token_refresh_error].call(data, config)
|
54
|
+
nil
|
53
55
|
else
|
54
56
|
raise UnknownError, response
|
55
57
|
end
|
data/lib/timedoctor/worker.rb
CHANGED
@@ -21,8 +21,7 @@ module TimeDoctor
|
|
21
21
|
when 200
|
22
22
|
JSON.parse(response.body, symbolize_names: true)
|
23
23
|
when 401
|
24
|
-
Token.new(config).refresh
|
25
|
-
exchange(method, url, params)
|
24
|
+
exchange(method, url, params) if Token.new(config).refresh
|
26
25
|
else
|
27
26
|
raise UnknownError, response
|
28
27
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timedoctor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Yak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|