Sha256: 177a811dfe756909f7d5f03a17ec848884a88f6ad4f9e626d8798dbc622d1f07

Contents?: true

Size: 579 Bytes

Versions: 5

Compression:

Stored size: 579 Bytes

Contents

module CodeBuddy
  class Stack
    attr_reader   :stack_frames
    attr_accessor :selected

    def initialize(exception_or_string)
      if exception_or_string.is_a?(Exception)
        backtrace = exception_or_string.backtrace
        backtrace = backtrace.first.split("\n") if backtrace.size == 1  #haml errors come through this way
      else
        backtrace = exception_or_string
      end

      @stack_frames = backtrace.collect do |string|
        StackFrame.new(string)
      end
    end

    def edit(index)
      @stack_frames[index].open_in_editor
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
code_buddy-0.1.2 lib/code_buddy/stack.rb
code_buddy-0.1.1 lib/code_buddy/stack.rb
code_buddy-0.1.0 lib/code_buddy/stack.rb
code_buddy-0.0.8 lib/code_buddy/stack.rb
code_buddy-0.0.7 lib/code_buddy/stack.rb