travis 1.6.8.travis.452.6 → 1.6.8.travis.453.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/travis/cli/command.rb +12 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGUwNzRmMjE1ZGRkNTU5N2FmYzIxYmE0MzM0OGZiZmJmNDMxZDZkMA==
4
+ NjAyNzI5YTY3NWQxZjBmZjg3ZmY2M2I1YTk5YTFmZmQ1ZDBiMWY3ZQ==
5
5
  data.tar.gz: !binary |-
6
- Y2NmMDUzMDdkYjY0YjIwN2ExMzQzZTZlMDA0NDRkOWQ5ZmYzMmFkYw==
6
+ ZTdjMWI2YmQxMjkzY2VjOGY3Y2ZkMTFlZjMzZWNkMDhhYzlkNzhjOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDc5MzI4NGQyZjE1NmVjYWZjZTQ2OTFjY2UxZjliOTM4MWRhNzI5NzEyYzYx
10
- YTk2NTEwY2ZlOTRhODI1ZTc4ZThlYjdjN2U4MjQ4YzAwMWIxNGEwOGJmZjA2
11
- ZmQ0NDI5NTg5ZTc2NzBjNmZkYzlkMTI1MzY2ZTAyNWE5NDA1ODY=
9
+ NjE0NGU1OTc0ZDM3NzIyMjJjNWFkOWNiY2ZlODg0MWQ5NTQ2ODAzYWQ5MTk3
10
+ YThjNjU2MTVmM2E4MmE0NWM3OTM2NTllMWRkZTU0NGFiMTUzNzQxZGU4OTQ0
11
+ YzM1ZWVkMDkxNWVkZDQ1Y2VkOWJhZmNjOGNjZmE1MDE1N2UyZjg=
12
12
  data.tar.gz: !binary |-
13
- NDU3MWFmZTJmYTgzN2NiNjlmN2FlZjUxNTg1ZjVlY2EwMGZkYjYzZmMxMThm
14
- YmI3ZWYxNmE3YmM2OGNhMjhlYjQ0YzFmNzZlOWI4NGIxZTc0NjdkZDI2MmY1
15
- NGExYjFmOWZhY2I1MzA0MDg4ZTk2OWQ5MWJjZmE3NDM5Y2ZhNjg=
13
+ ODFkNjc2Nzk5M2UxZDk4ZDg5MDE5YTdkZjhkYTcxMmRlMGFmNjg3Yzc1NmEw
14
+ ZGM4NmUxYTgzNGZiMmRhMmZiZGU0NTA3NjI0NTY1MWY0NzdiNzdiMzcwNDZi
15
+ ZTYxYTIyY2NkOGEyNjBlYTBkMzM3ZDkwZTMyYmQ1ZjQyYmFmZGY=
@@ -119,11 +119,19 @@ module Travis
119
119
 
120
120
  def check_version
121
121
  last_check.clear if last_check['version'] != Travis::VERSION
122
+ seconds_since = Time.now.to_i - last_check['at'].to_i
122
123
 
123
124
  return if skip_version_check?
124
- return if Time.now.to_i - last_check['at'].to_i < 3600
125
+ return if seconds_since < MINUTE
125
126
 
126
- Timeout.timeout 1.0 do
127
+ case seconds_since
128
+ when MINUTE .. HOUR then timeout = 0.5
129
+ when HOUR .. DAY then timeout = 1.0
130
+ when DAY .. WEEK then timeout = 2.0
131
+ else timeout = 10.0
132
+ end
133
+
134
+ Timeout.timeout(timeout) do
127
135
  response = Faraday.get('https://rubygems.org/api/v1/gems/travis.json', {}, 'If-None-Match' => last_check['etag'].to_s)
128
136
  last_check['etag'] = response.headers['etag']
129
137
  last_check['version'] = JSON.parse(response.body)['version'] if response.status == 200
@@ -131,7 +139,8 @@ module Travis
131
139
 
132
140
  last_check['at'] = Time.now.to_i
133
141
  error "Outdated CLI version, run `gem install travis` or use --skip-version-check." if Travis::VERSION < last_check['version']
134
- rescue Timeout::Error, Faraday::Error::ClientError
142
+ rescue Timeout::Error, Faraday::Error::ClientError => error
143
+ debug "#{error.class}: #{error.message}"
135
144
  end
136
145
 
137
146
  def check_completion
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.8.travis.452.6
4
+ version: 1.6.8.travis.453.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
@@ -32,7 +32,7 @@ authors:
32
32
  autorequire:
33
33
  bindir: bin
34
34
  cert_chain: []
35
- date: 2014-01-31 00:00:00.000000000 Z
35
+ date: 2014-02-03 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: faraday