Sha256: cf47be0b3233835462b98e8782ab01f4a2871b7776737fba56662b4f372c9174
Contents?: true
Size: 1.1 KB
Versions: 5
Compression:
Stored size: 1.1 KB
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 readline" if options[:debugger] begin require 'rubygems' 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 ADAPTOR_ENV = case ARGV.first when "d"; "development" when "t"; "test" else ARGV.first || 'development' end # set console environment libs << " -r #{ADAPTOR_ROOT}/config/environments/#{ADAPTOR_ENV}.rb" libs << " -r #{ADAPTOR_ROOT}/config/boot" puts "Loading #{ADAPTOR_ENV} environment (Adaptation #{Adaptation::VERSION::STRING})" exec "#{irb} #{libs} --simple-prompt"
Version data entries
5 entries across 5 versions & 1 rubygems