Class: Merb::Rack::Irb

Inherits:
Object show all
Defined in:
lib/merb-core/rack/adapter/irb.rb

Class Method Summary collapse

Class Method Details

.start(opts = {}) ⇒ Object

Parameters

opts<Hash>:

Options for IRB. Currently this is not used by the IRB adapter.

Notes

If the .irbrc file exists, it will be loaded into the IRBRC environment variable.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/merb-core/rack/adapter/irb.rb', line 85

def self.start(opts={})
  m = Merb::Rack::Console.new
  m.extend Merb::Test::RequestHelper
  Object.send(:define_method, :merb) { m }  
  ARGV.clear # Avoid passing args to IRB 
  m.open_sandbox! if sandboxed?
  require 'irb' 
  require 'irb/completion' 
  if File.exists? ".irbrc"
    ENV['IRBRC'] = ".irbrc"
  end
  IRB.start
  at_exit do merb.close_sandbox! if sandboxed? end
  exit
end