Class: Merb::Rack::Irb

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

Class Method Summary (collapse)

Class Method Details

+ (Object) start(opts = {})

Note:

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

Parameters:

  • opts (Hash) (defaults to: {})

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



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'merb-core/lib/merb-core/rack/adapter/irb.rb', line 111

def self.start(opts={})
  m = Merb::Rack::Console.new
  m.extend Merb::Test::RequestHelper
  m.extend ::Webrat::Methods if defined?(::Webrat)
  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