Skip to content

Instantly share code, notes, and snippets.

@aliang
Created June 12, 2011 08:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aliang/1021343 to your computer and use it in GitHub Desktop.
Save aliang/1021343 to your computer and use it in GitHub Desktop.
monkeypatch Rails::Application.load_console to load app-specific .irbrc
# taken from http://railsbros.de/2010/11/29/a-custom-irbrc-for-rails-3.html
# config/application.rb that is
module MyApp
class Application < Rails::Application
# config stuff comes here
def load_console(sandbox=false)
super
if File.exists?(project_specific_irbrc = File.join(Rails.root, ".irbrc"))
puts "Loading project specific .irbrc ..."
load(project_specific_irbrc)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment