Class: Pry

Inherits:
Object show all
Defined in:
lib/volt/cli/console.rb

Instance Method Summary collapse

Instance Method Details

#rep(target = TOPLEVEL_BINDING) ⇒ 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.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/volt/cli/console.rb', line 7

def rep(target = TOPLEVEL_BINDING)
  target = Pry.binding_for(target)
  result = re(target)

  Pry.critical_section do
    show_result(result)
  end

  # Automatically flush after each line
  Volt::Computation.flush!
end