diff options
author | Xavier Noria <fxn@hashref.com> | 2015-12-13 18:37:24 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-12-13 18:47:42 +0100 |
commit | 722359625903a1432e1f6197885ae5862608cba5 (patch) | |
tree | 400093b27d94d34a5bdbbf9fe01f74d8ac281ddd /railties/lib/rails/application | |
parent | 6be27016dff19fc7509d3668aba375fd332d6822 (diff) | |
download | rails-722359625903a1432e1f6197885ae5862608cba5.tar.gz rails-722359625903a1432e1f6197885ae5862608cba5.tar.bz2 rails-722359625903a1432e1f6197885ae5862608cba5.zip |
let config.file_watcher be the way to enable the evented file watcher
Before this commit, the sole presence of the Listen constant
enabled the evented file watcher (unless listen resorted to
the polling backend).
This way, applications may depend on listen for other stuff
independently of this feature. Also, allows teams with mixed
setups to decide at boot time whether the evented watcher
should be enabled for each particular instance.
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index a5550df0de..65cff1561a 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -44,7 +44,7 @@ module Rails @railties_order = [:all] @relative_url_root = ENV["RAILS_RELATIVE_URL_ROOT"] @reload_classes_only_on_change = true - @file_watcher = file_update_checker + @file_watcher = ActiveSupport::FileUpdateChecker @exceptions_app = nil @autoflush_log = true @log_formatter = ActiveSupport::Logger::SimpleFormatter.new @@ -191,26 +191,21 @@ module Rails SourceAnnotationExtractor::Annotation end - private - def file_update_checker - ActiveSupport::FileUpdateChecker + class Custom #:nodoc: + def initialize + @configurations = Hash.new end - class Custom #:nodoc: - def initialize - @configurations = Hash.new - end - - def method_missing(method, *args) - if method =~ /=$/ - @configurations[$`.to_sym] = args.first - else - @configurations.fetch(method) { - @configurations[method] = ActiveSupport::OrderedOptions.new - } - end + def method_missing(method, *args) + if method =~ /=$/ + @configurations[$`.to_sym] = args.first + else + @configurations.fetch(method) { + @configurations[method] = ActiveSupport::OrderedOptions.new + } end end + end end end end |