1
by Jacques Distler
Checkout of Instiki Trunk 1/21/2007.
1
#!/usr/bin/env ruby
2
irb = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb'
5
options = { :sandbox => false, :irb => irb }
6
OptionParser.new do |opt|
7
opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |options[:sandbox]| }
8
opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |options[:irb]| }
12
libs = " -r irb/completion"
13
libs << " -r #{File.dirname(__FILE__)}/../config/environment"
14
libs << " -r console_sandbox" if options[:sandbox]
16
ENV['RAILS_ENV'] = ARGV.first || 'development'
18
puts "Loading #{ENV['RAILS_ENV']} environment in sandbox."
19
puts "Any modifications you make will be rolled back on exit."
21
puts "Loading #{ENV['RAILS_ENV']} environment."
23
exec "#{options[:irb]} #{libs} --prompt-mode simple"