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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b83be5bd2fd6f52f68ffdbc06bf81eb2ceaa6cc
4
- data.tar.gz: ca30de4fae4eb69c21be20332ef038717d9acbe7
3
+ metadata.gz: e9018557ac9362a130a25aaa7c2aadc75273d136
4
+ data.tar.gz: 828f59328828cbc462eb8065372fb369e9483382
5
5
  SHA512:
6
- metadata.gz: f9800eb6c4b1b66ad08873f8b0173f12005e18c93a8f3d888c61a10433826da27356d2cf327195278c64293729149397ec5196f20d2d466a8b5de0a28677eeba
7
- data.tar.gz: 74965ed037312892f4759771496c51a7906968c56f9f7bb7eb9f7bfd0db2cede3524ee2fbb3bf07f934d522e896787e18062f30e8db3166662a748d0b6513b52
6
+ metadata.gz: 1cde407ae24825f2a08e869278f8fa73bf9f4832d89b7f744f0bc66c7c7f51fb815d025d68aefa151b2f8873b4aa1d1c272318c1e682fb71fdd1a5eb8e44c145
7
+ data.tar.gz: b5798e7e9b5b693c19124c694e1b3a517528165112469e155c2d4bb8b25a879a08f9d5591d7fb0d0f3e7c49d35c3957e1e1e51f85a5660355f7377279d85689e
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'leaseweb-rest-api'
3
- s.version = '1.1.5'
3
+ s.version = '1.1.6'
4
4
  s.authors = 'Arnoud Vermeer'
5
5
  s.email = 'a.vermeer@tech.leaseweb.com'
6
6
  s.license = 'Apache'
@@ -47,14 +47,18 @@ class LeasewebAPI
47
47
  end
48
48
 
49
49
  def validate_token(client_id)
50
- file = "#{@tmpdir}/#{client_id}.json"
51
- content = JSON.parse(File.read(file))
52
- expires_at = DateTime.parse(content['expires_at'])
53
-
54
- if expires_at > DateTime.now
55
- return content['access_token']
56
- else
57
- File.delete(file)
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.5
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-19 00:00:00.000000000 Z
11
+ date: 2017-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty