Class: RubyJard::Commands::OutputCommand

Inherits:
Pry::ClassCommand
  • Object
show all
Defined in:
lib/ruby_jard/commands/jard/output_command.rb

Overview

Command used to explore stacktrace.

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ OutputCommand

Returns a new instance of OutputCommand.



16
17
18
19
# File 'lib/ruby_jard/commands/jard/output_command.rb', line 16

def initialize(*args)
  super(*args)
  @session = (context[:session] || RubyJard::Session)
end

Instance Method Details

#processObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ruby_jard/commands/jard/output_command.rb', line 21

def process
  sleep 0.25 # Cool down
  pry_instance.pager.open(
    force_open: true,
    pager_start_at_the_end: true,
    prompt: 'Program output'
  ) do |pager|
    @session.output_buffer.each do |string|
      string.each do |s|
        pager.write(s)
      end
    end
  end
end