Sha256: cbbdc1f52a60e8621b6ed96cf14a3f0a7d06300ea5d311526f8f5b4277d8c77c
Contents?: true
Size: 910 Bytes
Versions: 15
Compression:
Stored size: 910 Bytes
Contents
require 'pry' class Pry # 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. 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 end module Volt class Console def self.start require 'pry' $LOAD_PATH << 'lib' ENV['SERVER'] = 'true' require 'volt' require 'volt/boot' require 'volt/server/socket_connection_handler_stub' SocketConnectionHandlerStub.dispatcher = Dispatcher.new Volt.boot(Dir.pwd) Pry.config.prompt_name = 'volt' # start a REPL session # Pry.start $page.pry end end end
Version data entries
15 entries across 15 versions & 1 rubygems