class Enolib::TerminalReporter

Public Class Methods

new(context) click to toggle source
Calls superclass method Enolib::Reporter::new
# File lib/enolib/reporters/terminal_reporter.rb, line 49
def initialize(context)
  super(context)

  highest_shown_line_number = @snippet.length

  @snippet.reverse.each_with_index do |tag, index|
    if tag && tag != :omission
      highest_shown_line_number = index + 1
      break
    end
  end

  @line_number_padding = [4, highest_shown_line_number.to_s.length].max
  @header = ''

  if @context.source
    @header += "#{BLACK + BRIGHT_RED_BACKGROUND} #{INDICATORS[EMPHASIZE]} #{' '.rjust(@line_number_padding)} #{RESET} #{BOLD}#{@context.source}#{RESET}\n"
  end
end

Public Instance Methods

print_line(line, tag) click to toggle source

Private Instance Methods

print() click to toggle source