Sha256: d637c1e410269d01d9f6ef6f5ff6657d7b6c4933e6ed7631a51ede06e91fb3ae
Contents?: true
Size: 714 Bytes
Versions: 17
Compression:
Stored size: 714 Bytes
Contents
module Locomotive::Steam class NoSiteException < ::Exception end class RenderError < ::StandardError LINES_RANGE = 10 attr_reader :file, :source, :line, :original_backtrace def initialize(message, file, source, line, original_backtrace) @file, @source, @line, @original_backtrace = file, source, line, original_backtrace super(message) end def code_lines return [] if source.blank? || line.nil? lines = source.split("\n") start = line - (LINES_RANGE / 2) start = 0 if start < 0 finish = line + (LINES_RANGE / 2) (start..finish).map { |i| [i, lines[i]] } end def backtrace original_backtrace end end end
Version data entries
17 entries across 17 versions & 1 rubygems