adk2 0.0.2 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/adk2/client.rb +3 -2
- data/lib/adk2/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c27e223244b8424eccd608cf2255784b58a43bc7
|
4
|
+
data.tar.gz: 07dc4daa2a8a478b58a765f0e591c3fe94e8a258
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10c851123b45fb3826254a685a3b63aecd0c9d1f856b8a99fc36ed95b9c225e762c9168c1f640e1bf4449d0baf1f6f560619f5454d3d8e8cee7ce5c74b653f1e
|
7
|
+
data.tar.gz: 907aab5bd7809f6107283cb94b7af071571366a6bbdd92c67d4ad624d014cdcea9b1a9c24d802d0ea9279dfe9debedcf0a60552a5690c0c96a023bd1d492675a
|
data/lib/adk2/client.rb
CHANGED
@@ -26,11 +26,12 @@ module Adk2
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def get_api_token
|
29
|
+
return @api_token = nil if @username.nil? || @password.nil?
|
29
30
|
response = RestClient.post(
|
30
31
|
api_base_url + '/auth',
|
31
32
|
{
|
32
33
|
'email' => @username,
|
33
|
-
'password' => @
|
34
|
+
'password' => @password
|
34
35
|
}.to_json
|
35
36
|
)
|
36
37
|
|
@@ -46,7 +47,7 @@ module Adk2
|
|
46
47
|
attr_reader :api_base_url, :api_token
|
47
48
|
|
48
49
|
def http_get(path, params = {})
|
49
|
-
Retryable.retryable(tries:
|
50
|
+
Retryable.retryable(tries: 2, on: RestClient::Forbidden) do |_, exception|
|
50
51
|
get_api_token if exception
|
51
52
|
|
52
53
|
RestClient.get(
|
data/lib/adk2/version.rb
CHANGED