charliesome/better_errors

View on GitHub
lib/better_errors/code_formatter/text.rb

Summary

Maintainability
A
0 mins
Test Coverage
module BetterErrors
  # @private
  class CodeFormatter::Text < CodeFormatter
    def source_unavailable
      "# Source is not available"
    end

    def formatted_lines
      each_line_of(context_lines) { |highlight, current_line, str|
        sprintf '%s %3d   %s', (highlight ? '>' : ' '), current_line, str
      }
    end
  end
end