diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-13 09:19:58 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-13 09:29:18 +0100 |
commit | cd3033eb627f408b71a7adf98c350e2c01115c33 (patch) | |
tree | 6acb4271c4e6040fb656ed0247c0daa12a888254 /railties/lib/rails | |
parent | 148d15d8244f72e2f5b3f2cc9087a43f9e35075f (diff) | |
download | rails-cd3033eb627f408b71a7adf98c350e2c01115c33.tar.gz rails-cd3033eb627f408b71a7adf98c350e2c01115c33.tar.bz2 rails-cd3033eb627f408b71a7adf98c350e2c01115c33.zip |
Add config.file_watcher so developers can provide their own watchers (for instance, hooking on fsevents).
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index aa6608d49e..35fae24297 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -1,5 +1,4 @@ require 'active_support/core_ext/hash/reverse_merge' -require 'active_support/file_update_checker' require 'fileutils' require 'rails/plugin' require 'rails/engine' @@ -135,7 +134,7 @@ module Rails end if config.reload_classes_only_on_change - reloader = ActiveSupport::FileUpdateChecker.new(watchable_args, true, &callback) + reloader = config.file_watcher.new(watchable_args, true, &callback) self.reloaders << reloader # We need to set a to_prepare callback regardless of the reloader result, i.e. # models should be reloaded if any of the reloaders (i18n, routes) were updated. diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 40deecea1c..dddf7e498f 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -1,5 +1,6 @@ require 'active_support/core_ext/string/encoding' require 'active_support/core_ext/kernel/reporting' +require 'active_support/file_update_checker' require 'rails/engine/configuration' module Rails @@ -7,8 +8,8 @@ module Rails class Configuration < ::Rails::Engine::Configuration attr_accessor :allow_concurrency, :asset_host, :asset_path, :assets, :cache_classes, :cache_store, :consider_all_requests_local, - :dependency_loading, :filter_parameters, :force_ssl, :helpers_paths, - :logger, :log_tags, :preload_frameworks, + :dependency_loading, :file_watcher, :filter_parameters, + :force_ssl, :helpers_paths, :logger, :log_tags, :preload_frameworks, :railties_order, :relative_url_root, :reload_plugins, :secret_token, :serve_static_assets, :ssl_options, :static_cache_control, :session_options, :time_zone, :reload_classes_only_on_change, :whiny_nils @@ -38,6 +39,7 @@ module Rails @railties_order = [:all] @relative_url_root = ENV["RAILS_RELATIVE_URL_ROOT"] @reload_classes_only_on_change = true + @file_watcher = ActiveSupport::FileUpdateChecker @assets = ActiveSupport::OrderedOptions.new @assets.enabled = false |