提交 bf4532df 编写于 作者: X Xavier Noria

encapsulates the logic to choose the file monitor in app config

上级 b7c8ce5b
......@@ -44,7 +44,7 @@ def initialize(*)
@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 @@ def annotations
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册