Sha256: 6291243b148349b6947c8d112cbe9754793e5cbc47639583804a6cd7a897e6cb

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

require 'travis/cli'

module Travis
  module CLI
    class Branches < RepoCommand
      description 'displays the most recent build for each branch'

      def run
        repository.last_on_branch.each do |build|
          say [
            color("#{build.branch_info}:".ljust(longest + 2), %i[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.14.0 lib/travis/cli/branches.rb
travis-1.13.3 lib/travis/cli/branches.rb
travis-1.13.2 lib/travis/cli/branches.rb
travis-1.13.1 lib/travis/cli/branches.rb
travis-1.13.0 lib/travis/cli/branches.rb
travis-1.12.0 lib/travis/cli/branches.rb