aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2015-11-10 07:27:46 -0800
committerXavier Noria <fxn@hashref.com>2015-11-10 22:19:35 +0100
commitbf4532dfdfa06f6fb00e2ce33cfb4f5b5dc43d50 (patch)
tree318d90916354b0340afff1406ec9990cdfc9df7c /railties
parentb7c8ce5bc2dbe12f1c21ebd8fd55953d891e98e3 (diff)
downloadrails-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')
-rw-r--r--railties/lib/rails/application/configuration.rb10
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