leaseweb-rest-api 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/leaseweb-rest-api.gemspec +1 -1
- data/lib/leaseweb-rest-api.rb +12 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9018557ac9362a130a25aaa7c2aadc75273d136
|
4
|
+
data.tar.gz: 828f59328828cbc462eb8065372fb369e9483382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cde407ae24825f2a08e869278f8fa73bf9f4832d89b7f744f0bc66c7c7f51fb815d025d68aefa151b2f8873b4aa1d1c272318c1e682fb71fdd1a5eb8e44c145
|
7
|
+
data.tar.gz: b5798e7e9b5b693c19124c694e1b3a517528165112469e155c2d4bb8b25a879a08f9d5591d7fb0d0f3e7c49d35c3957e1e1e51f85a5660355f7377279d85689e
|
data/leaseweb-rest-api.gemspec
CHANGED
data/lib/leaseweb-rest-api.rb
CHANGED
@@ -47,14 +47,18 @@ class LeasewebAPI
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def validate_token(client_id)
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
50
|
+
begin
|
51
|
+
file = "#{@tmpdir}/#{client_id}.json"
|
52
|
+
content = JSON.parse(File.read(file))
|
53
|
+
expires_at = DateTime.parse(content['expires_at'])
|
54
|
+
|
55
|
+
if expires_at > DateTime.now
|
56
|
+
return content['access_token']
|
57
|
+
else
|
58
|
+
File.delete(file)
|
59
|
+
end
|
60
|
+
rescue
|
61
|
+
return false
|
58
62
|
end
|
59
63
|
|
60
64
|
return false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leaseweb-rest-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnoud Vermeer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|