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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 032442944630e8efe8636bf520cddefeec30946a
4
- data.tar.gz: 58fc17ad7d3c661a3e8d165e66aaff6cabe65906
3
+ metadata.gz: 7d86102d4aac9035ffcd04e5b0d355807fb90452
4
+ data.tar.gz: f841eb8742a2e46ae51b51aba77fa616720dac05
5
5
  SHA512:
6
- metadata.gz: f050beaeec123d9898b1ff5db6ab893947b385fbf4c537720c23b441c916ef9f35231a764f6ae3bc58b4e46e6ac1411a942ea579381a39e75fbb636e561740cf
7
- data.tar.gz: afcd6cf4fb3dab79441fb536d2fd078f30cc1fd7f2d911243a9d14698a595c078648f0d08a19994fa9bd1c264c752a78a6795cffec7cc58961522f019a67c104
6
+ metadata.gz: 6f85f360258df234b25ea50719ddbaae878d40d4681073f28523d6fda17a8be014ab413de0432df50caeacdb293f892b52c09b4bf0b407688299c1062fca6ef9
7
+ data.tar.gz: 26c909e798f09712b3e3f726dd75cdccec5c155f6dad0fa3909a29e47019b4a7fd51046f2c6f64302ea85020b99d94457e714318bb353aeef4402e74b353d90b
@@ -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
- @logger.error "token expired" if @token.expired?
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
- @logger.error "token expired" if @token.expired?
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)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "testdroid-api-client"
3
- s.version = "0.2.1"
3
+ s.version = "0.2.2"
4
4
 
5
5
 
6
6
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testdroid-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sakari Rautiainen