lib/travis/cli/command.rb in travis-1.6.16 vs lib/travis/cli/command.rb in travis-1.6.17.travis.587.5
- old
+ new
@@ -156,13 +156,12 @@
last_check['etag'] = response.headers['etag']
last_check['version'] = JSON.parse(response.body)['version'] if response.status == 200
end
last_check['at'] = Time.now.to_i
- current = Travis::VERSION.split('.').map { |s| s.to_i }
- latest = last_check['version'].split('.').map { |s| s.to_i }
- check = current <=> latest
- error "Outdated CLI version, run `gem install travis` or use --skip-version-check." if check < 0
+ unless Tools::System.recent_version? Travis::VERSION, last_check['version']
+ error "Outdated CLI version, run `gem install travis` or use --skip-version-check."
+ end
rescue Timeout::Error, Faraday::Error::ClientError => error
debug "#{error.class}: #{error.message}"
end
def check_completion