Skip to content

Instantly share code, notes, and snippets.

@rdp
Created September 7, 2010 16:34
Show Gist options
  • Select an option

  • Save rdp/568628 to your computer and use it in GitHub Desktop.

Select an option

Save rdp/568628 to your computer and use it in GitHub Desktop.
C:\dev\digitalarchive_trunk>ir go.rb
irb(main):001:0> 33
=> 33
irb(main):002:0> exit
C:\dev\digitalarchive_trunk>cat go.rb
require 'irb'
module IRB # :nodoc:
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)
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
@CONF[:MAIN_CONTEXT] = irb.context
catch(:IRB_EXIT) do
irb.eval_input
end
end
end
IRB.start_session(binding)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment