Class: IRWebmachine::Pry::PrintStack
- Inherits:
-
Pry::ClassCommand
- Object
- Pry::ClassCommand
- IRWebmachine::Pry::PrintStack
- Defined in:
- lib/irwebmachine/pry/print_stack.rb
Instance Method Summary collapse
Instance Method Details
#options(opt) ⇒ Object
18 19 20 |
# File 'lib/irwebmachine/pry/print_stack.rb', line 18 def (opt) opt.on :f, 'Filter the stack with a regular expression.', optional: true end |
#process ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/irwebmachine/pry/print_stack.rb', line 22 def process frames = stack.to_a.map do |frame| if frame.ruby_call? && frame.to_s =~ filter frame.to_s end end.compact.join "\n" stagger_output text.with_line_numbers(frames, 0) end |
#setup ⇒ Object
14 15 16 |
# File 'lib/irwebmachine/pry/print_stack.rb', line 14 def setup @app = target.eval "app" end |