testdroid-api-client 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/testdroid_api/client.rb +5 -9
- data/testdroid-api-client.gemspec +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: 7d86102d4aac9035ffcd04e5b0d355807fb90452
|
4
|
+
data.tar.gz: f841eb8742a2e46ae51b51aba77fa616720dac05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f85f360258df234b25ea50719ddbaae878d40d4681073f28523d6fda17a8be014ab413de0432df50caeacdb293f892b52c09b4bf0b407688299c1062fca6ef9
|
7
|
+
data.tar.gz: 26c909e798f09712b3e3f726dd75cdccec5c155f6dad0fa3909a29e47019b4a7fd51046f2c6f64302ea85020b99d94457e714318bb353aeef4402e74b353d90b
|
data/lib/testdroid_api/client.rb
CHANGED
@@ -52,7 +52,7 @@ module TestdroidAPI
|
|
52
52
|
end
|
53
53
|
def upload(uri, filename, file_type)
|
54
54
|
begin
|
55
|
-
@token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
55
|
+
@token = @token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
56
56
|
connection = @token.client.connection
|
57
57
|
payload = {:file => Faraday::UploadIO.new(filename, file_type) }
|
58
58
|
headers = ACCEPT_HEADERS.merge(@token.headers)
|
@@ -65,7 +65,7 @@ module TestdroidAPI
|
|
65
65
|
end
|
66
66
|
def post(uri, params)
|
67
67
|
|
68
|
-
@token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
68
|
+
@token = @token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
69
69
|
|
70
70
|
begin
|
71
71
|
resp = @token.post("#{@cloud_url}#{uri}", params.merge(:headers => ACCEPT_HEADERS))
|
@@ -82,9 +82,7 @@ module TestdroidAPI
|
|
82
82
|
end
|
83
83
|
def get(uri, params={})
|
84
84
|
|
85
|
-
@
|
86
|
-
|
87
|
-
@token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
85
|
+
@token = @token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
88
86
|
|
89
87
|
begin
|
90
88
|
resp = @token.get(@cloud_url+"#{uri}", params.merge(:headers => ACCEPT_HEADERS))
|
@@ -96,9 +94,7 @@ module TestdroidAPI
|
|
96
94
|
end
|
97
95
|
def delete(uri)
|
98
96
|
|
99
|
-
@
|
100
|
-
|
101
|
-
@token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
97
|
+
@token = @token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
102
98
|
|
103
99
|
begin
|
104
100
|
resp = @token.delete(@cloud_url+"#{uri}", :headers => ACCEPT_HEADERS )
|
@@ -116,7 +112,7 @@ module TestdroidAPI
|
|
116
112
|
end
|
117
113
|
def download(uri, file_name)
|
118
114
|
begin
|
119
|
-
@token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
115
|
+
@token = @token.refresh!(:headers => ACCEPT_HEADERS) if @token.expired?
|
120
116
|
File.open(file_name, "w+b") do |file|
|
121
117
|
resp = @token.get("#{@cloud_url}/#{uri}", :headers => ACCEPT_HEADERS)
|
122
118
|
file.write(resp.body)
|