wework 0.2.5 → 0.2.6

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
  SHA1:
3
- metadata.gz: 7a13f4efa0bdcb221c5674159c58beaf161da617
4
- data.tar.gz: e36845104a87a62b4a9b507fa8ed7a2cd523e01d
3
+ metadata.gz: f6ee37102d3877e1fe4208f3bf1125febeb4c5f1
4
+ data.tar.gz: 657524866686143b2a1d1c6adc97b7c9aa366fe2
5
5
  SHA512:
6
- metadata.gz: b02fdfa00c3a71c44ea41ca18077e0d9e625e2aa60a350948af9fc2e78487e92a89843ca3e679ad5de5dded66b045308c259534ef23b637f64c84b0df9d0331a
7
- data.tar.gz: a5aa6c3f08e72733cff3ea1a9f298c342c1057c0920b1fa7391335c085ca07d04000328e24c498871ace05445dad9e9feed530a3ceb11eecae1eab5926feb47e
6
+ metadata.gz: 295b787230ca11c0bfd8e533f305db84b523131ca8fc878e5fa1f1b7bbad300dcb7c050baba458ff890948d1806006aead9a6dfa619862da1aeffc892aea4a69
7
+ data.tar.gz: 3a9206d6548cba4fae41b2770368dcb299d9183dc55223acb9cbb3c523a5f43b5933779f289a127896a793566dab54888318c9482e475e259b9f8254efb883f1
@@ -13,7 +13,7 @@ module Wework
13
13
  end
14
14
 
15
15
  def expired?
16
- redis.hvals(key).empty? || redis.hget(key, "expires_at") <= Time.now.to_i
16
+ redis.hvals(key).empty? || redis.hget(key, "expires_at").to_i <= Time.now.to_i
17
17
  end
18
18
 
19
19
  def refresh_token
@@ -17,7 +17,12 @@ module Wework
17
17
  end
18
18
 
19
19
  def refresh_token
20
- app.get 'get_jsapi_ticket'
20
+ result = app.get 'get_jsapi_ticket'
21
+ if defined?(Rails)
22
+ Rails.logger.warn "[WEWORK] refresh JsTicket(#{app.corp_id}): #{result.inspect}"
23
+ end
24
+
25
+ result
21
26
  end
22
27
 
23
28
  private
@@ -13,7 +13,7 @@ module Wework
13
13
  end
14
14
 
15
15
  def expired?
16
- redis.hvals(key).empty? || redis.hget(key, "expires_at") <= Time.now.to_i
16
+ redis.hvals(key).empty? || redis.hget(key, "expires_at").to_i <= Time.now.to_i
17
17
  end
18
18
 
19
19
  def refresh_token
@@ -17,7 +17,12 @@ module Wework
17
17
  end
18
18
 
19
19
  def refresh_token
20
- app.request.get 'gettoken', params: {corpid: app.corp_id, corpsecret: app.app_secret}
20
+ result = app.request.get 'gettoken', params: {corpid: app.corp_id, corpsecret: app.app_secret}
21
+ if defined?(Rails)
22
+ Rails.logger.warn "[WEWORK] refresh Token(#{app.corp_id}): #{result.inspect}"
23
+ end
24
+
25
+ result
21
26
  end
22
27
 
23
28
  private
@@ -1,3 +1,3 @@
1
1
  module Wework
2
- VERSION = '0.2.5'.freeze
2
+ VERSION = '0.2.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - seandong