Sha256: 64c70ffd6f1b9612e2f0ac571fb98fe2fa4430d8fb9041f3d5caf6485a57e01d

Contents?: true

Size: 523 Bytes

Versions: 3

Compression:

Stored size: 523 Bytes

Contents

class RenderMePretty::Erb
  class MainErrorHandler < BaseHandler
    # For general Tilt errors first line of the backtrace that contains the path
    # of the file we're rendeirng and has the line number. Example:
    #
    #   spec/fixtures/invalid.erb:2:in `block in singleton class'
    #   error_info = e.backtrace[0]
    def find_line_number
      lines = @exception.backtrace
      error_line = lines.select do |line|
        line.include?(@path)
      end.first
      error_line.split(':')[1].to_i
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
render_me_pretty-0.7.1 lib/render_me_pretty/erb/main_error_handler.rb
render_me_pretty-0.7.0 lib/render_me_pretty/erb/main_error_handler.rb
ufo-3.0.1 vendor/render_me_pretty/lib/render_me_pretty/erb/main_error_handler.rb