travis 1.5.9.travis.361.4 → 1.5.9.travis.362.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +1 -0
  3. data/lib/travis/cli/monitor.rb +18 -11
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTM3ZGUxYTZiNWEzNTE3YWU1ODZkMGEyNTY1ZTUzOWY5NWI3ZjE4OA==
4
+ ZGRlZmY3OWEwNGNjODg0ZTA4Y2U2ZDk1YTZjYTgyZWM3N2NmNWE5OQ==
5
5
  data.tar.gz: !binary |-
6
- MjgxNmY1ODE0N2Q3ZWEzMGNiNmZlNjliNzVjOWRlZjRiMmI0YjA0MA==
6
+ OGVkNzMzMzM4YWEzOGNiYjI0MmJmNWRmZDcxNTZiM2E1NDgwNWY4Yg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZjVlNmY4NWFlNzc5YWE4NTVjYTZjYzQ0ZDQ1Y2Y2Yzc0NGNjY2U1MDgyYjUx
10
- MTY2YTg5NWZjNzdhNWJhYzc0NDA5ZjdlN2I2ZTAzNTBlZmZiZDYwM2U4N2Yw
11
- Zjc4Yjk2OTlhYTIyODU4ZTE3ZTQ0M2UwNzFiOTIyZDA0NTQ0ODU=
9
+ OGM4M2IxZjZlNGIwNjYzNmRiYmVlOGUyODNjMzEwMDJlNmEzN2RkNjQ5NzQ4
10
+ N2U2MTk2YjdkZmI4Mjk3YjYwNWE1ZDNhZGM3NjU4NTdhNDkwNWExNWJhOGNm
11
+ NTkxNTkxYWI4NTNiMTAyYmYxODExY2E2ODEwNDljYmMwMjhiM2E=
12
12
  data.tar.gz: !binary |-
13
- NDk5YzYxZGZkYzM5Y2Y5ZGZhYTM4ZmQ2YjNhNmFhOGNiZWI2NjQxM2ZiYjZk
14
- NThhOTBlMTc3YjAwYWM5MmQ1NTZhNzY0YTcwMjY0ODNiMGVkM2ZjYjU0Zjc0
15
- MmQ2ZWI2ZGRiNzQ4MWQ5NTI2NDFmY2MyMDJlMGJlYzg2ZDBiYTk=
13
+ NjNmNTU2YzQ3YTZkYTRlMzZjNWE5Mjg1MDZlMmM4NjE5NWVlYjZjNWI5Nzdh
14
+ MmI2MWJlMzQzYWI1MmNmZDE5NGMwYzE2NzI3ODQ2M2RiNTgzMzJkNjc3ZWI0
15
+ Y2VmMmFhNWY0MDczODE4Yzk3N2EzODJmZTFlZTk0NDVjZGM4ZWE=
data/README.md CHANGED
@@ -1448,6 +1448,7 @@ If you have the old `travis-cli` gem installed, you should `gem uninstall travis
1448
1448
  * Add `travis cache` to list and delete directory caches.
1449
1449
  * Add `travis report` to give a report of the system, endpoint, configuration and last exception.
1450
1450
  * Add `Cache` entity.
1451
+ * Keep `travis monitor` running on API errors.
1451
1452
 
1452
1453
  **1.5.8** (October 24, 2013)
1453
1454
 
@@ -72,20 +72,27 @@ module Travis
72
72
  entity.pull_request? ? pull? : push?
73
73
  end
74
74
 
75
+ def display(entity, time)
76
+ say [
77
+ color(formatter.time(time), entity.color),
78
+ color(entity.inspect_info, [entity.color, :bold]),
79
+ color(entity.state, entity.color)
80
+ ].join(" ")
81
+ notification.notify(entity.repository.slug, "#{entity.class.name[/[^:]+$/]} ##{entity.number} #{entity.state}")
82
+ end
83
+
84
+ def handle_event(event)
85
+ entity = event.job || event.build
86
+ time = entity.finished_at || entity.started_at
87
+ display(entity, time) if monitor? entity
88
+ rescue Travis::Client::Error => error
89
+ raise error if explode?
90
+ end
91
+
75
92
  def run
76
93
  listen(*repos) do |listener|
77
94
  listener.on_connect { say description, "Monitoring #{"builds for " if builds?}%s:" }
78
- listener.on(*events) do |event|
79
- entity = event.job || event.build
80
- time = entity.finished_at || entity.started_at
81
- next unless monitor? entity
82
- say [
83
- color(formatter.time(time), entity.color),
84
- color(entity.inspect_info, [entity.color, :bold]),
85
- color(entity.state, entity.color)
86
- ].join(" ")
87
- notification.notify(entity.repository.slug, "#{entity.class.name[/[^:]+$/]} ##{entity.number} #{entity.state}")
88
- end
95
+ listener.on(*events) { |e| handle_event(e) }
89
96
  end
90
97
  end
91
98
  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.5.9.travis.361.4
4
+ version: 1.5.9.travis.362.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase