console

来自「ruby on rails web敏捷开发之路第二版 源代码」· 代码 · 共 23 行

TXT
23
字号
#!/Users/dave/ruby1.8/bin/rubyirb = 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)endlibs =  " -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."endexec "#{irb} #{libs}"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?