Class: GitSnip::Printer

Inherits:
Object
  • Object
show all
Defined in:
lib/git_snip/printer.rb

Instance Method Summary collapse

Constructor Details

#initialize(cli) ⇒ Printer

Returns a new instance of Printer.



5
6
7
# File 'lib/git_snip/printer.rb', line 5

def initialize(cli)
  @cli = cli
end

Instance Method Details

#branch_info(row) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/git_snip/printer.rb', line 33

def branch_info(row)
  @cli.say row.sha + ' ', :yellow
  @cli.say row.name + ' ', :magenta
  @cli.say row.date + ' ', :green
  @cli.say row.author + ' ', [:blue, :bold]
  @cli.say row.message.strip + "\n"
end

#deleting_branchesObject



13
14
15
# File 'lib/git_snip/printer.rb', line 13

def deleting_branches
  @cli.say "Deleting the following branches...\n\n", :green
end

#doneObject



29
30
31
# File 'lib/git_snip/printer.rb', line 29

def done
  @cli.say "\nDone.", :green
end

#force_option_neededObject



9
10
11
# File 'lib/git_snip/printer.rb', line 9

def force_option_needed
  @cli.say '-f option is needed to delete branches.', :red
end

#no_branches_deletedObject



17
18
19
# File 'lib/git_snip/printer.rb', line 17

def no_branches_deleted
  @cli.say 'No branches were deleted.', :green
end

#no_branches_to_deleteObject



25
26
27
# File 'lib/git_snip/printer.rb', line 25

def no_branches_to_delete
  @cli.say 'No branches would be deleted.', :green
end

#will_delete_branchesObject



21
22
23
# File 'lib/git_snip/printer.rb', line 21

def will_delete_branches
  @cli.say "Would delete the following branches...\n\n", :green
end