Skip to content

Instantly share code, notes, and snippets.

@ajvargo
Created February 26, 2011 21:13
Show Gist options
  • Save ajvargo/845632 to your computer and use it in GitHub Desktop.
Save ajvargo/845632 to your computer and use it in GitHub Desktop.
Homemade IRB Console, like Rails!
#!/usr/bin/env ruby
# console, generally inspired by rails console
#
# put in root of project, adjust file paths and the like
# chmod the file to be executable by you
# run:
# project_root >> ./console
# first require
Dir[File.dirname(__FILE__) + '/*.rb'].each {|file| require file }
# mmm... irb
require 'irb'
require 'irb/completion'
# notice the load instead of require
def reload!
puts "Reloadin'"
Dir[File.dirname(__FILE__) + '/*.rb'].each {|file| load file }
true
end
# fire it up, hoss!
IRB.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment