Class: Pry::REPL
Instance Method Summary collapse
-
#repl ⇒ Object
To make the console more useful, we make it so we flush the event registry after each line.
Instance Method Details
#repl ⇒ Object
To make the console more useful, we make it so we flush the event registry after each line. This makes it so events are triggered after each line. To accomplish this we monkey-patch pry.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/volt/cli/console.rb', line 8 def repl loop do case val = read when :control_c output.puts "" pry.reset_eval_string when :no_more_input output.puts "" if output.tty? break else output.puts "" if val.nil? && output.tty? return pry.exit_value unless pry.eval(val) end # Flush after each line Volt::Computation.flush! Volt::Timers.flush_next_tick_timers! end end |