module C80GitBash::Utils

Constants

BLACK
BLUE
BOLD
CLEAR
CYAN
DATE_PADDING
FILENAME_PADDING
GREEN
LOG_MESSAGE_LINE_SIZE
MAGENTA
RED
WHITE
YELLOW

Public Instance Methods

format_file_name(filename) click to toggle source
# File lib/c80_git_bash/utils.rb, line 19
def format_file_name(filename)
  "#{GREEN}#{filename.ljust(FILENAME_PADDING, '.')}#{CLEAR}"
end
format_git_date(d) click to toggle source
# File lib/c80_git_bash/utils.rb, line 40
def format_git_date(d)
  "#{BLUE}[#{d.to_s.split(' ')[0]}]#{CLEAR}"
end
format_git_message(s) click to toggle source

see utils_spec.rb: format_git_message

# File lib/c80_git_bash/utils.rb, line 24
def format_git_message(s)

  n = LOG_MESSAGE_LINE_SIZE
  m = []

  s = s.ljust(s.size + (n - s.size % n), ' ')
  s.scan(/.{#{n}}/).each do |line|
    m << line
  end
end
format_git_message_join(s) click to toggle source
# File lib/c80_git_bash/utils.rb, line 35
def format_git_message_join(s)
  m = self.format_git_message(s)
  m.join("#{BLACK}\n  #{''.ljust(FILENAME_PADDING + DATE_PADDING - 1, '.')}#{CLEAR} ")
end