Class: GitTopic::Formatter::Branches

Inherits:
Object
  • Object
show all
Includes:
Helper, Term::ANSIColor
Defined in:
lib/git_topic/formatter/branches.rb

Overview

summarizes branches information

Defined Under Namespace

Classes: Branch

Instance Method Summary collapse

Methods included from Helper

#truncate

Constructor Details

#initialize(options) ⇒ Branches

Returns a new instance of Branches.



13
14
15
# File 'lib/git_topic/formatter/branches.rb', line 13

def initialize(options)
  @all = options[:all]
end

Instance Method Details



18
19
20
21
22
23
24
# File 'lib/git_topic/formatter/branches.rb', line 18

def print
  puts "#{bold}[Branches]#{clear}" if @all
  branches, current_branch = parse_branches
  parse_length(branches)
  print_header
  print_contents(branches, current_branch)
end