samnang
1/2/2011 - 2:01 AM

Tips – Simulate Rails Console in Ruby Project

Tips – Simulate Rails Console in Ruby Project

#!/usr/bin/env ruby
app_path = File.expand_path("../", File.dirname(__FILE__))

boot_path =  File.join(app_path,"boot")

command = "irb -r irb/completion -r #{boot_path}"
exec command
require 'irb'
ARGV.clear
IRB.start