travis 1.6.15.travis.558.6 → 1.6.15.travis.559.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjY0YjVhNDJjYjA3MDA5MzY4NDY2MTUwODM0MTU1ZGY1YzQ5YzQ2MQ==
4
+ OWZhNzk4MTMxMzAyZGVjYWIwMTY1N2I4NWU4NTBiMWZiZjk1OGY4Yg==
5
5
  data.tar.gz: !binary |-
6
- OGRlNzM4MmQyMjYxNDYzMzA5Y2I2NmJmZjJjMTEzODg3NDdiYjJmYg==
6
+ MGZlZjBhNzE2NmNkZjU2NzU4MjY5NzY4NzE4NjQ5ZmIxNGE0OWI4MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTFmMmRlM2M0MTM0NjdhMDM3Y2M1N2ZhMTEzNWFlOWMzYTdjNTczZWE0OGIx
10
- YTAxMmQwMzZjZGYwNTUyNjQxNGZlYzU5NDhlYThkZWRmNzAzOGJmYTY1Y2Y2
11
- YzIzMDJhYzcyMjc0OTQyY2FlOTA5ZDI4MmI5NDA4ZDcwZGM0MTE=
9
+ ZDNmMzhmZmUwNDk3ODcxMmEwNTJjZjk0ZjU5N2M2YjhlYzRmOTgxYzFlYWIx
10
+ MThiZWI1ZjlmZWFiYzZkMmZkNGIxZDBlMjBmMDhkZjY3YzMzZmY2ODc1MjFk
11
+ YmQ1MjA4ODkzZDgyZjA5NGE5ODFhMDdiYzNmNTg4OGFmMzc4MWQ=
12
12
  data.tar.gz: !binary |-
13
- ODNiZmJjNzIyNDM3OTdmZjg3ZTRhMjQwYmNmZWZkY2ViZjcwYWM3OTFkNDEz
14
- NDhjMjBlNzhiMGUyMTEzNDNiM2NlNzdlYTdkYjYyZjIwNDU3MGNkOTEyNWY4
15
- ZDA1MzQyNjlhNTM0OTFiNzM4YjNkZTE0NTI4ODg1MWY5ODVjMjc=
13
+ OTIzZTZlYzI5OWM0MjVmNGQ2MDFmMjRlMWQwZTgwZDNlMGZjNTA0YzkxNWMy
14
+ NzIxOTJmYTk2YjE4Y2NlNTE1MGZkMzZmZDlmYTJhZWIyZWIzNjMwMDMzZjE2
15
+ MmM4NTA1OTZiNzRhODgzNmNlODc3YWNhM2M5M2Q3ZTRmMmYzY2M=
@@ -13,6 +13,15 @@ module Travis
13
13
  # @!parse attr_reader :job
14
14
  has :job
15
15
 
16
+ def delete_body(reason = {})
17
+ reason = { reason: reason } unless reason.is_a? Hash
18
+ session.patch_raw("jobs/#{job_id}/log", reason)
19
+ reload
20
+ rescue Travis::Client::Error => error
21
+ raise unless error.message == '409'
22
+ self
23
+ end
24
+
16
25
  def encoded_body
17
26
  Tools::SafeString.encoded(body)
18
27
  end
@@ -28,7 +37,11 @@ module Travis
28
37
  def current_body
29
38
  attributes['current_body'] ||= begin
30
39
  body = load_attribute('body')
31
- body.to_s.empty? ? session.get_raw("jobs/#{job_id}/log") : body
40
+ if body.to_s.empty?
41
+ log = session.get_raw("jobs/#{job_id}/log")
42
+ body = String === log ? log : log['log']['body']
43
+ end
44
+ body
32
45
  end
33
46
  end
34
47
 
@@ -20,6 +20,12 @@ module Travis
20
20
  many :builds
21
21
  aka :branch, :branches
22
22
 
23
+ def delete_logs(reason = {})
24
+ jobs.each do |job|
25
+ job.delete_log(reason)
26
+ end
27
+ end
28
+
23
29
  def push?
24
30
  not pull_request?
25
31
  end
@@ -45,6 +45,10 @@ module Travis
45
45
  end
46
46
  end
47
47
 
48
+ def delete_log(reason = {})
49
+ log.delete_body(reason)
50
+ end
51
+
48
52
  def pusher_channels
49
53
  build.pusher_channels + ["job-#{id}"]
50
54
  end
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.15.travis.558.6
4
+ version: 1.6.15.travis.559.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
@@ -39,7 +39,7 @@ authors:
39
39
  autorequire:
40
40
  bindir: bin
41
41
  cert_chain: []
42
- date: 2014-07-01 00:00:00.000000000 Z
42
+ date: 2014-07-07 00:00:00.000000000 Z
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: faraday