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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1863262f810d0a719b977fe636c3533d7466f0a34d39ab89f72384c9ef0ca5b7
4
- data.tar.gz: 74229ed160f0c670c813975561b54009b5d0be70d1ed63642d9f41f7a6ba8e4c
3
+ metadata.gz: 33918c2259c31cc6f11abb684362dcae5b969fcd0c3b198f093572e790792ea6
4
+ data.tar.gz: 8dcf9a6c665d9c8481d980496fdb7d53bb8914a001a56862013b82ca9af668f0
5
5
  SHA512:
6
- metadata.gz: f52af45bb440b0a8d7b408cd70d867e7153c74934e46ee850be47512680ddf851856733af4c745707f330f18a2be40d72205a8f5a62d881d04f0288bd0b1053a
7
- data.tar.gz: f1158310c37b58803bc15bc7862e1f422e1c81ccdf9df38b305ecb9f47ca0bec0cfa34182eb8d4f64e1de3e264be1d43f4edb112f3679c4e7ecebe910cd0fd0c
6
+ metadata.gz: e7a15ae306835747cadf1af29c88c7d81a0aecc94e85c20fb49a78ce06982668b520d766b92930f7b81cc18cbb4ea70c8dd3b1de7a5279e9704a6aafb83f6e87
7
+ data.tar.gz: 6f16bed4f4dcfc6815b50ecaf631deb178eb4772a9845c08f8e4db5f62aa8f9929de613d9a8c5579cb0eaa1f401aa55c242558615061f84fd377158cb13736ef
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- timedoctor (0.3.1)
4
+ timedoctor (0.3.2)
5
5
  faraday (~> 0.15.0)
6
6
 
7
7
  GEM
@@ -19,10 +19,12 @@ config = {
19
19
 
20
20
  # access_token:
21
21
  # "Y2ZkMGY5OTA1NGI3NmJjZTZlYWJlYjczNGM4N2E2NTYwZjFmNzhjZGVhMGY3ZmU0MTIyZjQ5NTNkOGIzYWI3ZA",
22
- # refresh_token:
23
- # "ZmM3OTg1NjZmYjgwYmZlYzM2NzAwMjFlZmFhZmU4MDk1Y2ZhZWNlYjMyYTg0NzlmMzRmNzBiOWM5NTUxNjY4MA",
24
- # user_id: 1188995,
25
- # company_id: 587525,
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
- p TimeDoctor::Auth.new(config).fetch_token
41
- # p TimeDoctor::Client.new(config).authorize
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
  #
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module TimeDoctor
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
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.1
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-03 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday