Class: GitSnip::Printer
- Inherits:
-
Object
- Object
- GitSnip::Printer
- Defined in:
- lib/git_snip/printer.rb
Instance Method Summary collapse
- #branch_info(row) ⇒ Object
- #deleting_branches ⇒ Object
- #done ⇒ Object
- #force_option_needed ⇒ Object
-
#initialize(cli) ⇒ Printer
constructor
A new instance of Printer.
- #no_branches_deleted ⇒ Object
- #no_branches_to_delete ⇒ Object
- #will_delete_branches ⇒ Object
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. + ' ', [:blue, :bold] @cli.say row..strip + "\n" end |
#deleting_branches ⇒ Object
13 14 15 |
# File 'lib/git_snip/printer.rb', line 13 def deleting_branches @cli.say "Deleting the following branches...\n\n", :green end |
#done ⇒ Object
29 30 31 |
# File 'lib/git_snip/printer.rb', line 29 def done @cli.say "\nDone.", :green end |
#force_option_needed ⇒ Object
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_deleted ⇒ Object
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_delete ⇒ Object
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_branches ⇒ Object
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 |