Sha256: ccc8a9284f0b86112c4a308f155340cac40f49f699d82f1b6914df1ca036b08f

Contents?: true

Size: 546 Bytes

Versions: 6

Compression:

Stored size: 546 Bytes

Contents

require 'travis/cli'

module Travis
  module CLI
    class Branches < RepoCommand
      def run
        repository.last_on_branch.each do |build|
          say [
            color("#{build.branch_info}:".ljust(longest + 2), [:info, :bold]),
            color("##{build.number.to_s.ljust(4)} #{build.state}".ljust(16), build.color),
            build.commit.subject
          ].join(" ").strip + "\n"
        end
      end

      private

        def longest
          repository.branches.keys.map { |b| b.size }.max
        end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
travis-1.5.2 lib/travis/cli/branches.rb
travis-1.5.1 lib/travis/cli/branches.rb
travis-1.5.0 lib/travis/cli/branches.rb
travis-1.4.0 lib/travis/cli/branches.rb
travis-1.3.1 lib/travis/cli/branches.rb
travis-1.3.0 lib/travis/cli/branches.rb