class FindT::Printer

Constants

COLORS

Public Class Methods

new(root_path, isatty) click to toggle source
# File lib/find_t/printer.rb, line 18
def initialize(root_path, isatty)
  @root_path = Pathname.new root_path
  @isatty = isatty
end

Public Instance Methods

print_header() click to toggle source
print_results(founds) click to toggle source

Private Instance Methods

color(str, c) click to toggle source
# File lib/find_t/printer.rb, line 77
        def color(str, c)
  @isatty ? "\e[1;%dm%s\e[0m" % [30 + COLORS[c], str] : str
end
print_empty() click to toggle source
print_title(title) click to toggle source
print_translation(found, conflicted) click to toggle source
printable_text(text) click to toggle source
# File lib/find_t/printer.rb, line 68
        def printable_text(text)
  (text == '') ? '{ ... }' : text
end
relative_path(file) click to toggle source
# File lib/find_t/printer.rb, line 72
        def relative_path(file)
  return file unless @root_path
  Pathname.new(file).relative_path_from(@root_path).to_s
end