Sha256: 8f568d7c900536e5b660c49af1cb893cddddd8a81ffcc2806afec079d6f0cc67

Contents?: true

Size: 698 Bytes

Versions: 6

Compression:

Stored size: 698 Bytes

Contents

#!/usr/local/bin/ruby
irb = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb'

require 'optparse'
options = {}
OptionParser.new do |opt|
  opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |options[:sandbox]| }
  opt.parse!(ARGV)
end

libs =  " -r #{File.dirname(__FILE__)}/../config/environment"
libs << " -r #{File.dirname(__FILE__)}/console_sandbox" if options[:sandbox]
libs << " -r irb/completion"

ENV['RAILS_ENV'] = ARGV.first || 'development'
if options[:sandbox]
  puts "Loading #{ENV['RAILS_ENV']} environment in sandbox."
  puts "Any modifications you make will be rolled back on exit."
else
  puts "Loading #{ENV['RAILS_ENV']} environment."
end
exec "#{irb} #{libs}"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails-0.11.1 bin/console
rails-0.12.0 bin/console
rails-0.11.0 bin/console
rails-0.10.0 bin/console
rails-0.10.1 bin/console
rails-0.12.1 bin/console