Created
February 26, 2011 21:13
-
-
Save ajvargo/845632 to your computer and use it in GitHub Desktop.
Homemade IRB Console, like Rails!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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