Module: IRB
- Defined in:
- lib/fargo/ext/irb.rb
Overview
See url below for where this came from jameskilton.com/2009/04/02/embedding-irb-into-your-ruby-application/
Class Method Summary collapse
Class Method Details
.start_session(binding) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/fargo/ext/irb.rb', line 6 def self.start_session(binding) unless @__initialized args = ARGV ARGV.replace(ARGV.dup) IRB.setup(nil) ARGV.replace(args) @__initialized = true end workspace = WorkSpace.new(binding) irb = Irb.new(workspace) trap('SIGINT') do irb.signal_handle end @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC] @CONF[:MAIN_CONTEXT] = irb.context @CONF[:PROMPT][@CONF[:PROMPT_MODE]][:RETURN].replace '' yield if block_given? catch(:IRB_EXIT) do irb.eval_input end end |