class GitLeft::BranchReporter

Public Class Methods

new(branch) click to toggle source
# File lib/git_left/branch_reporter.rb, line 3
def initialize(branch)
  @branch = branch
end

Public Instance Methods

branch_info() click to toggle source
# File lib/git_left/branch_reporter.rb, line 12
def branch_info
  str = "\nDeciding time: #{underlined(@branch.name)}"

  if @branch.is_upstream?
    str << green(" (exists upstream)") 
  end

  str
end
green(text) click to toggle source
# File lib/git_left/branch_reporter.rb, line 30
def green(text)
  "\e[32m#{text}\e[0m"
end
instructions() click to toggle source
# File lib/git_left/branch_reporter.rb, line 22
def instructions
  "(h to delete, l to skip, anything else to quit)\n"
end
report() click to toggle source
# File lib/git_left/branch_reporter.rb, line 7
def report
  puts branch_info
  puts instructions
end
underlined(text) click to toggle source
# File lib/git_left/branch_reporter.rb, line 26
def underlined(text)
  "\e[4m" << text << "\e[24m"
end