diff options
author | Xavier Noria <fxn@hashref.com> | 2015-11-10 07:27:46 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-11-10 22:19:35 +0100 |
commit | bf4532dfdfa06f6fb00e2ce33cfb4f5b5dc43d50 (patch) | |
tree | 318d90916354b0340afff1406ec9990cdfc9df7c /railties/lib/rails/application | |
parent | b7c8ce5bc2dbe12f1c21ebd8fd55953d891e98e3 (diff) | |
download | rails-bf4532dfdfa06f6fb00e2ce33cfb4f5b5dc43d50.tar.gz rails-bf4532dfdfa06f6fb00e2ce33cfb4f5b5dc43d50.tar.bz2 rails-bf4532dfdfa06f6fb00e2ce33cfb4f5b5dc43d50.zip |
encapsulates the logic to choose the file monitor in app config
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 6d68eea220..6d89caf514 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 = (defined?(Listen) && Listen::Adapter.select()!=Listen::Adapter::Polling)? ActiveSupport::FileEventedUpdateChecker : ActiveSupport::FileUpdateChecker + @file_watcher = file_update_checker @exceptions_app = nil @autoflush_log = true @log_formatter = ActiveSupport::Logger::SimpleFormatter.new @@ -181,6 +181,14 @@ module Rails end private + def file_update_checker + if defined?(Listen) && Listen::Adapter.select() != Listen::Adapter::Polling + ActiveSupport::FileEventedUpdateChecker + else + ActiveSupport::FileUpdateChecker + end + end + class Custom #:nodoc: def initialize @configurations = Hash.new |