travis 1.6.8.travis.453.6 → 1.6.8.travis.454.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
- NjAyNzI5YTY3NWQxZjBmZjg3ZmY2M2I1YTk5YTFmZmQ1ZDBiMWY3ZQ==
4
+ Mzg1NGNhNDk4OGZmYjc2OTc0NWNmOGE1NTIzYTM5NTBjN2M5Y2RkNg==
5
5
  data.tar.gz: !binary |-
6
- ZTdjMWI2YmQxMjkzY2VjOGY3Y2ZkMTFlZjMzZWNkMDhhYzlkNzhjOA==
6
+ OGM4YzZmMmNjN2FlZmEyMjM3NGVmYzZiODdkMmExMTRhMzg4MmIyZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjE0NGU1OTc0ZDM3NzIyMjJjNWFkOWNiY2ZlODg0MWQ5NTQ2ODAzYWQ5MTk3
10
- YThjNjU2MTVmM2E4MmE0NWM3OTM2NTllMWRkZTU0NGFiMTUzNzQxZGU4OTQ0
11
- YzM1ZWVkMDkxNWVkZDQ1Y2VkOWJhZmNjOGNjZmE1MDE1N2UyZjg=
9
+ ZTdkOGZkYTBmNGVhNzU5YzI3OWUyNjNkNTkzYjE0NzQ0MDdkNWM3NTUwYTI0
10
+ NDQ4MWVlYTk2ZjdkYzM0MTNjN2QwZjFjYTIyMjI5M2M3NmI4MWU5ODMzOTUw
11
+ Y2MyNTZkNmNjMzBiMjExMDMyMGQ2NWMxMTlmZGMyMDkzMDE0Njk=
12
12
  data.tar.gz: !binary |-
13
- ODFkNjc2Nzk5M2UxZDk4ZDg5MDE5YTdkZjhkYTcxMmRlMGFmNjg3Yzc1NmEw
14
- ZGM4NmUxYTgzNGZiMmRhMmZiZGU0NTA3NjI0NTY1MWY0NzdiNzdiMzcwNDZi
15
- ZTYxYTIyY2NkOGEyNjBlYTBkMzM3ZDkwZTMyYmQ1ZjQyYmFmZGY=
13
+ ZWRlYTJjZjY3OGEzYzEyMjAzN2RmNDlkZjZjMjE3N2Q5NTZjN2QyZmIzZjcz
14
+ M2IyOTA2NTY4OTIyMmI0MTZkMTE3ZDQ3NWU3MTkxYWI1MmYxYmUyYzEyZDhk
15
+ NWM0ODJhNTQyYmYyZTdhMWY2MzdmZTMwY2ViMjg1NGQxMTgyYzk=
@@ -13,6 +13,11 @@ require 'timeout'
13
13
  module Travis
14
14
  module CLI
15
15
  class Command
16
+ MINUTE = 60
17
+ HOUR = 3600
18
+ DAY = 86400
19
+ WEEK = 604800
20
+
16
21
  include Tools::Assets
17
22
  extend Parser, Forwardable, Tools::Assets
18
23
  def_delegators :terminal, :agree, :ask, :choose
@@ -16,6 +16,7 @@ require 'json'
16
16
  module Travis
17
17
  module Client
18
18
  class Session
19
+ PRIMITIVE = [nil, false, true]
19
20
  SSL_OPTIONS = { :ca_file => Tools::Assets['cacert.pem'] }
20
21
 
21
22
  include Methods
@@ -274,6 +275,7 @@ module Travis
274
275
  end
275
276
 
276
277
  def create_entity(type, data)
278
+ return data if primitive?(data)
277
279
  data = { type.id_field => data } if type.id? data
278
280
  id = type.cast_id(data.fetch(type.id_field)) unless type.weak?
279
281
  entity = id ? cached(type, :id, id) { type.new(self, id) } : type.new(self, nil)
@@ -281,6 +283,10 @@ module Travis
281
283
  entity
282
284
  end
283
285
 
286
+ def primitive?(data)
287
+ PRIMITIVE.include? data
288
+ end
289
+
284
290
  def error_message(e)
285
291
  message = e.response[:body].to_str rescue e.message
286
292
  JSON.parse(message).fetch('error').fetch('message') rescue message
@@ -25,7 +25,11 @@ module Travis
25
25
  end
26
26
 
27
27
  def permissions
28
- attributes['permissions'] ||= session.get('/users/permissions')
28
+ attributes['permissions'] ||= begin
29
+ repos = session.get('/users/permissions')
30
+ repos.each_value { |r| r.compact! }
31
+ repos
32
+ end
29
33
  end
30
34
 
31
35
  def repositories
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.453.6
4
+ version: 1.6.8.travis.454.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-02-03 00:00:00.000000000 Z
35
+ date: 2014-02-04 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: faraday