travis 1.7.2.travis.623.5 → 1.7.2.travis.625.5

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
- NmU3Yzk4MzEyMjZkNDMwMjE3OGMzZWQyNDliMDc0NmQ2ZjdjNWExOQ==
4
+ MmY5M2ZlZTU2MGY4ZTM5NDAzM2Y1NDI3ZDg0NDJiMTRlNjljZjhlOQ==
5
5
  data.tar.gz: !binary |-
6
- N2RkYmYxNzA3ZGZmZDQ1ZTIxMzU5Njk0N2UxNjIzZTczYzJmZmZjOA==
6
+ YjEzODMxMTllZmYxNjIzMGQ2NzQ3NTMyYThlZTlhZjdhOGJlNzBkNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDUxZjdlY2U4NGRhMTc5MWI1ZTEwMWNjYzgxZGVmN2RmMTI4MmMzNWE5NjJk
10
- NzE3YzNlZTBiMDlkNTllN2Q3MWM1NjMyMmRkOWQ1ZjNhZTc0NjJjMTczNTE4
11
- NTg4MWEwNmNiYjIyZmZjNTNiYWMxM2YwMmM0MTAwOTYzOWQxODQ=
9
+ ZmEzN2VhYjg2YTE4NTJiZmJmNWRkY2RjNGI5Y2RlN2UzMjM1NTU1NTVkODU1
10
+ ODcyYjAxNWE1ZTVlZDgxMWUzNjQyOTRkN2UzZTcxZGIwNTM5ZWRkMjRjM2Qz
11
+ YTcxMzc2NDcyYjMzYjIzZDY1YmMyYTEzMTVlNjBlNzQ2MmM2N2Q=
12
12
  data.tar.gz: !binary |-
13
- ZjQyNGY4N2VlNGE2ZDNhMWYxYWExODA5M2JmYmYzNTJiNGQwNjdjODYyYmMz
14
- Nzk1OTc4MTA0ZGJlZGFjZGY5MzY1MmZiNGQ3MTg3ZjY4Y2Y5OWI5YzA3MzE4
15
- NDNiMjk4MTU3MmI2NjUyOGMwZjM3MTNjNDY2ODQ1NTQ3ZTFiYjU=
13
+ ZGVkNDQyOTk0ODAzNThmNDEyZjZjMTdhMjA5MWRhMThmNGU4ZWMxZjhkMDgw
14
+ M2YxMDgwMDUyNDMxYzU3NDZmMmRhYjdjMzIyNGZlODNhN2MzNmZmMzk4YjMx
15
+ ZGY2M2RmMjk0Nzk4MjQ5OGU3ZWRmODY1ODg0ZTdjNTc3ZDRlOWQ=
@@ -8,18 +8,24 @@ module Travis
8
8
  def run
9
9
  authenticate
10
10
  accounts.each do |account|
11
- color = account.subscribed? ? :green : :info
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.subscribed? ? "subscribed," : "not subscribed,",
15
+ "#{description(account)},",
16
16
  account.repos_count == 1 ? "1 repository" : "#{account.repos_count} repositories"
17
17
  ].join(" ")
18
18
  end
19
- unless accounts.all?(&:subscribed?) or session.config['host'].nil?
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.623.5
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-08-14 00:00:00.000000000 Z
43
+ date: 2014-09-05 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: faraday