Skip to content

Instantly share code, notes, and snippets.

@stevenberg
Created December 14, 2012 13:59
Show Gist options
  • Save stevenberg/4285636 to your computer and use it in GitHub Desktop.
Save stevenberg/4285636 to your computer and use it in GitHub Desktop.
Automatic Reloading in Rails Console
# http://jkfill.com/2012/12/08/automatic-code-reloading-in-rails-console
# put this in config/initializeers/irb_reloading.rb
if defined?(IRB::Context) && !defined?(Rails::Server) && Rails.env.development?
class IRB::Context
def evaluate_with_reloading(line, line_no)
reload!(true)
evaluate_without_reloading(line, line_no)
end
alias_method_chain :evaluate, :reloading
end
puts "=> IRB code reloading enabled"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment