aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/railtie/configuration.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-12 22:51:33 +0100
committerJosé Valim <jose.valim@gmail.com>2011-12-12 22:54:04 +0100
commitfa1d9a884c0d5b70c97442e3360ac98ca5fa4340 (patch)
treee39e017a9de2936a87f3b9ecf1d14b6febd0a8f1 /railties/lib/rails/railtie/configuration.rb
parent62cda03fa824ce1e1fc92aaee0367c29ade6a504 (diff)
downloadrails-fa1d9a884c0d5b70c97442e3360ac98ca5fa4340.tar.gz
rails-fa1d9a884c0d5b70c97442e3360ac98ca5fa4340.tar.bz2
rails-fa1d9a884c0d5b70c97442e3360ac98ca5fa4340.zip
Speed up development by only reloading classes if dependencies files changed.
This can be turned off by setting `config.reload_classes_only_on_change` to false. Extensions like Active Record should add their respective files like db/schema.rb and db/structure.sql to `config.watchable_files` if they want their changes to affect classes reloading. Thanks to https://github.com/paneq/active_reload and Pastorino for the inspiration. <3
Diffstat (limited to 'railties/lib/rails/railtie/configuration.rb')
-rw-r--r--railties/lib/rails/railtie/configuration.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/rails/railtie/configuration.rb b/railties/lib/rails/railtie/configuration.rb
index f888684117..cf9e4ad500 100644
--- a/railties/lib/rails/railtie/configuration.rb
+++ b/railties/lib/rails/railtie/configuration.rb
@@ -7,6 +7,18 @@ module Rails
@@options ||= {}
end
+ # Add files that should be watched for change.
+ def watchable_files
+ @@watchable_files ||= []
+ end
+
+ # Add directories that should be watched for change.
+ # The key of the hashes should be directories and the values should
+ # be an array of extensions to match in each directory.
+ def watchable_dirs
+ @@watchable_dirs ||= {}
+ end
+
# This allows you to modify the application's middlewares from Engines.
#
# All operations you run on the app_middleware will be replayed on the