diff options
author | Xavier Noria <fxn@hashref.com> | 2015-12-13 18:59:34 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-12-13 18:59:34 +0100 |
commit | a94d4045103ecbeb890822477a07ca84512340d8 (patch) | |
tree | ae598a98257a648619ed7179aa5c2fcd4bdfd97e /activesupport | |
parent | 722359625903a1432e1f6197885ae5862608cba5 (diff) | |
download | rails-a94d4045103ecbeb890822477a07ca84512340d8.tar.gz rails-a94d4045103ecbeb890822477a07ca84512340d8.tar.bz2 rails-a94d4045103ecbeb890822477a07ca84512340d8.zip |
lazy load listen in core
See the rationale in the comment present in this patch.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/evented_file_update_checker.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/evented_file_update_checker.rb b/activesupport/lib/active_support/evented_file_update_checker.rb index c1c30b1a86..315be85fb3 100644 --- a/activesupport/lib/active_support/evented_file_update_checker.rb +++ b/activesupport/lib/active_support/evented_file_update_checker.rb @@ -1,4 +1,3 @@ -require 'listen' require 'set' require 'pathname' require 'concurrent/atomic/atomic_boolean' @@ -19,6 +18,10 @@ module ActiveSupport @lcsp = @ph.longest_common_subpath(@dirs.keys) if (dtw = directories_to_watch).any? + # Loading listen triggers warnings. These are originated by a legit + # usage of attr_* macros for private attributes, but adds a lot of noise + # to our test suite. Thus, we lazy load it and disable warnings locally. + silence_warnings { require 'listen' } Listen.to(*dtw, &method(:changed)).start end end |