travis 1.6.3.travis.388.4 → 1.6.3.travis.389.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/travis/client/artifact.rb +9 -2
- data/lib/travis/client/session.rb +17 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDQyYTc2Yzg0M2M5YTQ4NmY5ZWQwY2JmMTdlZmYyY2VjOTU4NWFmYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2ZkM2I4ZTRjMzA4ZTdjNzA0ZGM1NTJlYzA0MTQxZmMxYzZiM2QzZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzY0YzRiNTk2YzY0N2Q2ZTY4N2NjYWJmZjcxMTgyZGU1NjljZTI2ZTA5ZmQ1
|
10
|
+
YzI1ZmVjMTlmNmZhMDQ5ZGIxZTc0OTUwNTIwMzhjNWQ4YzliNzc1N2IxNWJk
|
11
|
+
NTkyNDQ4OTI5ZGYxZWY4MGI0YTMxOTUyNWE0N2FhODdjZDEyNzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDU1MTM4YjZjZGQ0NDI3NDViNDhmMDdlNWNiOTliYzk2MjM0MTk4NWQ4MWY4
|
14
|
+
OGVlYmUxMzViODg5Mjk0Zjg0YmJkZDRkOTI3OGNlYzJmNmI4YzYzNjNkM2Vi
|
15
|
+
NDU0ZjllMTExZGFkZGY2NDU2MzhlYWE4MjJkZjA4OWYzNzljMTM=
|
@@ -25,9 +25,16 @@ module Travis
|
|
25
25
|
attributes['clean_body'] ||= Tools::SafeString.clean(body)
|
26
26
|
end
|
27
27
|
|
28
|
+
def current_body
|
29
|
+
attributes['current_body'] ||= begin
|
30
|
+
body = load_attribute('body')
|
31
|
+
body.to_s.empty? ? session.get_raw("jobs/#{job_id}/log") : body
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
28
35
|
def body(stream = block_given?)
|
29
|
-
return
|
30
|
-
return yield(
|
36
|
+
return current_body unless block_given? or stream
|
37
|
+
return yield(current_body) unless stream and job.pending?
|
31
38
|
number = 0
|
32
39
|
|
33
40
|
session.listen(self) do |listener|
|
@@ -56,9 +56,6 @@ module Travis
|
|
56
56
|
clear_cache!
|
57
57
|
self.connection = Faraday.new(:url => uri, :ssl => ssl) do |faraday|
|
58
58
|
faraday.request :url_encoded
|
59
|
-
faraday.response :json
|
60
|
-
faraday.response :follow_redirects
|
61
|
-
faraday.response :raise_error
|
62
59
|
faraday.adapter(*faraday_adapter)
|
63
60
|
end
|
64
61
|
end
|
@@ -173,11 +170,23 @@ module Travis
|
|
173
170
|
|
174
171
|
def raw(verb, url, *args)
|
175
172
|
url = url.sub(/^\//, '')
|
176
|
-
result = instrumented(verb.to_s.upcase, url, *args)
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
173
|
+
result = instrumented(verb.to_s.upcase, url, *args) do
|
174
|
+
connection.public_send(verb, url, *args) do |request|
|
175
|
+
next if request.path !~ /^https?:/ or request.path.start_with? api_endpoint
|
176
|
+
request.headers.delete("Authorization")
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
case result.status
|
181
|
+
when 0 then raise Travis::Client::Error, 'SSL error: could not verify peer'
|
182
|
+
when 200..299 then JSON.parse(result.body) rescue result.body
|
183
|
+
when 301, 303 then raw(:get, result.headers['Location'])
|
184
|
+
when 302, 307, 308 then raw(verb, result.headers['Location'])
|
185
|
+
when 404 then raise Travis::Client::NotFound, result.body
|
186
|
+
when 400..499 then raise Travis::Client::Error, result.status
|
187
|
+
when 500..599 then raise Travis::Client::Error, "server error (#{result.status})"
|
188
|
+
else raise Travis::Client::Error, "unhandled status code #{result.status}"
|
189
|
+
end
|
181
190
|
end
|
182
191
|
|
183
192
|
def inspect
|
@@ -240,12 +249,6 @@ module Travis
|
|
240
249
|
entity
|
241
250
|
end
|
242
251
|
|
243
|
-
def handle_error(e)
|
244
|
-
klass = Travis::Client::NotFound if e.is_a? Faraday::Error::ResourceNotFound
|
245
|
-
klass ||= Travis::Client::Error
|
246
|
-
raise klass, error_message(e), e.backtrace
|
247
|
-
end
|
248
|
-
|
249
252
|
def error_message(e)
|
250
253
|
message = e.response[:body].to_str rescue e.message
|
251
254
|
JSON.parse(message).fetch('error').fetch('message') rescue message
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: travis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.3.travis.
|
4
|
+
version: 1.6.3.travis.389.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
@@ -29,7 +29,7 @@ authors:
|
|
29
29
|
autorequire:
|
30
30
|
bindir: bin
|
31
31
|
cert_chain: []
|
32
|
-
date: 2013-11-
|
32
|
+
date: 2013-11-24 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: faraday
|