Class: BitGirder::Irb::Session

Inherits:
BitGirderClass
  • Object
show all
Defined in:
lib/bitgirder/irb.rb

Instance Method Summary collapse

Instance Method Details

#runObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/bitgirder/irb.rb', line 27

def run
 
    if IRB.conf[ :MAIN_CONTEXT ]
        raise "IRB session already running (a MAIN_CONTEXT is set)?"
    end

    IRB.setup( nil )
    irb = IRB::Irb.new
    IRB.conf[ :MAIN_CONTEXT ] = irb.context

    @setup.call( irb.context.workspace.main ) if @setup

    trap( "SIGINT" ) { irb.signal_handle }

    catch( :IRB_EXIT ) { irb.eval_input }
end