travis 1.7.2.travis.623.5 → 1.7.2.travis.625.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/travis/cli/accounts.rb +9 -3
- data/lib/travis/client/account.rb +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmY5M2ZlZTU2MGY4ZTM5NDAzM2Y1NDI3ZDg0NDJiMTRlNjljZjhlOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjEzODMxMTllZmYxNjIzMGQ2NzQ3NTMyYThlZTlhZjdhOGJlNzBkNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmEzN2VhYjg2YTE4NTJiZmJmNWRkY2RjNGI5Y2RlN2UzMjM1NTU1NTVkODU1
|
10
|
+
ODcyYjAxNWE1ZTVlZDgxMWUzNjQyOTRkN2UzZTcxZGIwNTM5ZWRkMjRjM2Qz
|
11
|
+
YTcxMzc2NDcyYjMzYjIzZDY1YmMyYTEzMTVlNjBlNzQ2MmM2N2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGVkNDQyOTk0ODAzNThmNDEyZjZjMTdhMjA5MWRhMThmNGU4ZWMxZjhkMDgw
|
14
|
+
M2YxMDgwMDUyNDMxYzU3NDZmMmRhYjdjMzIyNGZlODNhN2MzNmZmMzk4YjMx
|
15
|
+
ZGY2M2RmMjk0Nzk4MjQ5OGU3ZWRmODY1ODg0ZTdjNTc3ZDRlOWQ=
|
data/lib/travis/cli/accounts.rb
CHANGED
@@ -8,18 +8,24 @@ module Travis
|
|
8
8
|
def run
|
9
9
|
authenticate
|
10
10
|
accounts.each do |account|
|
11
|
-
color = account.
|
11
|
+
color = account.on_trial? ? :info : :green
|
12
12
|
say [
|
13
13
|
color(account.login, [color, :bold]),
|
14
14
|
color("(#{account.name || account.login.capitalize}):", color),
|
15
|
-
account
|
15
|
+
"#{description(account)},",
|
16
16
|
account.repos_count == 1 ? "1 repository" : "#{account.repos_count} repositories"
|
17
17
|
].join(" ")
|
18
18
|
end
|
19
|
-
unless accounts.
|
19
|
+
unless accounts.none?(&:on_trial?) or session.config['host'].nil?
|
20
20
|
say session.config['host'], "To set up a subscription, please visit %s."
|
21
21
|
end
|
22
22
|
end
|
23
|
+
|
24
|
+
def description(account)
|
25
|
+
return "subscribed" if account.subscribed?
|
26
|
+
return "educational account" if account.educational?
|
27
|
+
"not subscribed"
|
28
|
+
end
|
23
29
|
end
|
24
30
|
end
|
25
31
|
end
|
@@ -3,7 +3,7 @@ require 'travis/client'
|
|
3
3
|
module Travis
|
4
4
|
module Client
|
5
5
|
class Account < Entity
|
6
|
-
attributes :name, :login, :type, :repos_count, :subscribed
|
6
|
+
attributes :name, :login, :type, :repos_count, :subscribed, :education
|
7
7
|
|
8
8
|
one :account
|
9
9
|
many :accounts
|
@@ -23,6 +23,14 @@ module Travis
|
|
23
23
|
load_attribute('subscribed') { true } if member?
|
24
24
|
end
|
25
25
|
|
26
|
+
def education
|
27
|
+
load_attribute('education') { false } if member?
|
28
|
+
end
|
29
|
+
|
30
|
+
def on_trial?
|
31
|
+
!subscribed? and !education?
|
32
|
+
end
|
33
|
+
|
26
34
|
def repos_count
|
27
35
|
load_attribute("repos_count") { repositories.count }
|
28
36
|
end
|
@@ -35,6 +43,8 @@ module Travis
|
|
35
43
|
session.accounts.include? self
|
36
44
|
end
|
37
45
|
|
46
|
+
alias educational? education?
|
47
|
+
|
38
48
|
private
|
39
49
|
|
40
50
|
def load_attribute(name, &block)
|
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.7.2.travis.
|
4
|
+
version: 1.7.2.travis.625.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
@@ -40,7 +40,7 @@ authors:
|
|
40
40
|
autorequire:
|
41
41
|
bindir: bin
|
42
42
|
cert_chain: []
|
43
|
-
date: 2014-
|
43
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
44
44
|
dependencies:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: faraday
|