Sha256: 187c20c522c3e0cd66b61cb566366e84481352d1fbb158d430586dbb77ffb31c

Contents?: true

Size: 818 Bytes

Versions: 178

Compression:

Stored size: 818 Bytes

Contents

require 'travis/cli'

module Travis
  module CLI
    class Accounts < ApiCommand
      description "displays accounts and their subscription status"

      def run
        authenticate
        accounts.each do |account|
          color = account.subscribed? ? :green : :info
          say [
            color(account.login, [color, :bold]),
            color("(#{account.name || account.login.capitalize}):", color),
            account.subscribed?      ? "subscribed,"  : "not subscribed,",
            account.repos_count == 1 ? "1 repository" : "#{account.repos_count} repositories"
          ].join(" ")
        end
        unless accounts.all?(&:subscribed?) or session.config['host'].nil?
          say session.config['host'], "To set up a subscription, please visit %s."
        end
      end
    end
  end
end

Version data entries

178 entries across 178 versions & 1 rubygems

Version Path
travis-1.6.8.travis.456.6 lib/travis/cli/accounts.rb
travis-1.6.8.travis.455.6 lib/travis/cli/accounts.rb
travis-1.6.8.travis.454.6 lib/travis/cli/accounts.rb
travis-1.6.8.travis.453.6 lib/travis/cli/accounts.rb
travis-1.6.8.travis.452.6 lib/travis/cli/accounts.rb
travis-1.6.8.travis.451.6 lib/travis/cli/accounts.rb
travis-1.6.8.travis.450.6 lib/travis/cli/accounts.rb
travis-1.6.8.travis.449.6 lib/travis/cli/accounts.rb
travis-1.6.8.travis.447.6 lib/travis/cli/accounts.rb
travis-1.6.7.travis.446.6 lib/travis/cli/accounts.rb
travis-1.6.7 lib/travis/cli/accounts.rb
travis-1.6.7.travis.445.6 lib/travis/cli/accounts.rb
travis-1.6.7.travis.443.6 lib/travis/cli/accounts.rb
travis-1.6.7.travis.442.6 lib/travis/cli/accounts.rb
travis-1.6.7.travis.441.6 lib/travis/cli/accounts.rb
travis-1.6.7.travis.434.6 lib/travis/cli/accounts.rb
travis-1.6.7.travis.431.6 lib/travis/cli/accounts.rb
travis-1.6.7.travis.428.9 lib/travis/cli/accounts.rb
travis-1.6.7.travis.427.9 lib/travis/cli/accounts.rb
travis-1.6.7.travis.426.8 lib/travis/cli/accounts.rb