class MetaRuby::GUI::ExceptionRendering::BacktraceParser

Shim class that parses a backtrace into its constituents

This is an internal class, that should not be used directly. Use {ExceptionRendering.parse_backtrace} instead.

It provides the methods required for facet's call_stack method to work, thus allowing to use it to parse an arbitrary backtrace

Public Class Methods

new(backtrace) click to toggle source

Create a parser for the given backtrace

# File lib/metaruby/gui/exception_rendering.rb, line 100
def initialize(backtrace)
    @backtrace = backtrace || []
end

Public Instance Methods

parse() click to toggle source

Parse the backtrace into file, line and method

@return [Array<(String,Integer,String)>]

# File lib/metaruby/gui/exception_rendering.rb, line 107
def parse
    call_stack(0)
end
pp_call_stack(level) click to toggle source

Returns the backtrace

This is required by facet's call_stack

# File lib/metaruby/gui/exception_rendering.rb, line 121
def pp_call_stack(level)
    @backtrace[level..-1]
end
pp_callstack(level) click to toggle source

Returns the backtrace

This is required by facet's call_stack

# File lib/metaruby/gui/exception_rendering.rb, line 114
def pp_callstack(level)
    @backtrace[level..-1]
end