Sha256: 9894e180c44bee5aeb747f79f3f67e85cb26abaf0d8b56c4f09c33b91ee04900
Contents?: true
Size: 789 Bytes
Versions: 37
Compression:
Stored size: 789 Bytes
Contents
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb' require 'optparse' options = { :irb => irb } OptionParser.new do |opt| opt.banner = "Usage: console [environment] [options]" opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |v| options[:irb] = v } opt.on("--debugger", 'Enable ruby-debugging for the console.') { |v| options[:debugger] = v } opt.parse!(ARGV) end libs = " -r irb/completion" libs << %( -r "#{APP_ROOT}/config/environment") if options[:debugger] begin require 'ruby-debug' libs << " -r ruby-debug" puts "=> Debugger enabled" rescue Exception puts "You need to install ruby-debug to run the console in debugging mode. With gems, use 'gem install ruby-debug'" exit end end exec "#{options[:irb]} #{libs} --simple-prompt"
Version data entries
37 entries across 37 versions & 2 rubygems