Skip to content

Instantly share code, notes, and snippets.

@citrus
Created March 11, 2011 08:04
Show Gist options
  • Save citrus/865602 to your computer and use it in GitHub Desktop.
Save citrus/865602 to your computer and use it in GitHub Desktop.
A rails engine that reloads the lib/dev folder on each development request. Useful for developing gems.
module DevEngine
class Engine < Rails::Engine
def self.activate
Dir.glob(File.join(File.dirname(__FILE__), "dev/**/*.rb")) do |c|
print "loading #{c}... "
Rails.env.production? ? require(c) : load(c)
puts "done."
end
end
config.to_prepare &method(:activate).to_proc
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment