Module: IRWebmachine::IRB::Bundle

Included in:
IRB::ExtendCommandBundle
Defined in:
lib/irwebmachine/irb/bundle.rb

Instance Method Summary collapse

Instance Method Details

#appObject



2
3
4
# File 'lib/irwebmachine/irb/bundle.rb', line 2

def app
  IRWebmachine.app || raise(RuntimeError, "No app set. Use IRWebmachine.app= to set one.", []) 
end

#enter_stack(num) ⇒ Object



14
15
16
17
18
19
# File 'lib/irwebmachine/irb/bundle.rb', line 14

def enter_stack(num) 
  request = app.last_request
  trace = request.stack[num]
  puts "==> Entering #{trace.klass}##{trace.method}"
  irb(trace.binding)
end

#show_stack(filter = //) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/irwebmachine/irb/bundle.rb', line 6

def show_stack(filter = //)
  request = app.last_request 
  request.stack.each_with_index do |trace, int|
    puts "#{int}> #{trace}" if trace.to_s =~ filter
  end
  nil
end