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 +8 -8
- data/lib/travis/cli/command.rb +5 -0
- data/lib/travis/client/session.rb +6 -0
- data/lib/travis/client/user.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Mzg1NGNhNDk4OGZmYjc2OTc0NWNmOGE1NTIzYTM5NTBjN2M5Y2RkNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGM4YzZmMmNjN2FlZmEyMjM3NGVmYzZiODdkMmExMTRhMzg4MmIyZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTdkOGZkYTBmNGVhNzU5YzI3OWUyNjNkNTkzYjE0NzQ0MDdkNWM3NTUwYTI0
|
10
|
+
NDQ4MWVlYTk2ZjdkYzM0MTNjN2QwZjFjYTIyMjI5M2M3NmI4MWU5ODMzOTUw
|
11
|
+
Y2MyNTZkNmNjMzBiMjExMDMyMGQ2NWMxMTlmZGMyMDkzMDE0Njk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWRlYTJjZjY3OGEzYzEyMjAzN2RmNDlkZjZjMjE3N2Q5NTZjN2QyZmIzZjcz
|
14
|
+
M2IyOTA2NTY4OTIyMmI0MTZkMTE3ZDQ3NWU3MTkxYWI1MmYxYmUyYzEyZDhk
|
15
|
+
NWM0ODJhNTQyYmYyZTdhMWY2MzdmZTMwY2ViMjg1NGQxMTgyYzk=
|
data/lib/travis/cli/command.rb
CHANGED
@@ -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
|
data/lib/travis/client/user.rb
CHANGED
@@ -25,7 +25,11 @@ module Travis
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def permissions
|
28
|
-
attributes['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.
|
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-
|
35
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
36
36
|
dependencies:
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: faraday
|