WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
File tree Expand file tree Collapse file tree 7 files changed +13
-7
lines changed
Expand file tree Collapse file tree 7 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def _usable_adapter_class
3636
3737 def _warn_polling_fallback ( options )
3838 msg = options . fetch ( :polling_fallback_message , POLLING_FALLBACK_MESSAGE )
39- Kernel . warn "[Listen warning]:\n #{ msg } " if msg
39+ Listen . adapter_warn ( "[Listen warning]:\n #{ msg } " ) if msg
4040 end
4141 end
4242 end
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def self.usable?
3434 require 'find'
3535 true
3636 rescue LoadError
37- Kernel . warn BUNDLER_DECLARE_GEM
37+ Listen . adapter_warn ( BUNDLER_DECLARE_GEM )
3838 false
3939 end
4040
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def self.usable?
3030 require 'rb-fsevent'
3131 fsevent_version = Gem ::Version . new ( FSEvent ::VERSION )
3232 return true if fsevent_version <= Gem ::Version . new ( '0.9.4' )
33- Kernel . warn INCOMPATIBLE_GEM_VERSION
33+ Listen . adapter_warn ( INCOMPATIBLE_GEM_VERSION )
3434 false
3535 end
3636
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def self.usable?
2020 Listen . logger . debug format ( 'wdm - load failed: %s:%s' , $ERROR_INFO,
2121 $ERROR_POSITION * "\n " )
2222
23- Kernel . warn BUNDLER_DECLARE_GEM
23+ Listen . adapter_warn ( BUNDLER_DECLARE_GEM )
2424 false
2525 end
2626
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ def verify_unwatched!(entry)
3030 @real_dirs . add? ( real_path ) or _fail ( entry . sys_path , real_path )
3131 end
3232
33+ # Leaving this stub here since some warning work-arounds were referring to it.
34+ # Deprecated. Will be removed in Listen v4.0.
35+ def warn ( message )
36+ Listen . adapter_warn ( message )
37+ end
38+
3339 private
3440
3541 def _fail ( symlinked , real_path )
Original file line number Diff line number Diff line change 3535 context 'with rb-fsevent > 0.9.4' do
3636 before { stub_const ( 'FSEvent::VERSION' , '0.9.6' ) }
3737 it 'shows a warning and should not be usable' do
38- expect ( Kernel ) . to receive ( :warn )
38+ expect ( Listen ) . to receive ( :adapter_warn )
3939 expect ( subject ) . to_not be_usable
4040 end
4141 end
Original file line number Diff line number Diff line change 4949
5050 it 'warns polling fallback with default message' do
5151 msg = described_class ::POLLING_FALLBACK_MESSAGE
52- expect ( Kernel ) . to receive ( :warn ) . with ( "[Listen warning]:\n #{ msg } " )
52+ expect ( Listen ) . to receive ( :adapter_warn ) . with ( "[Listen warning]:\n #{ msg } " )
5353 Listen ::Adapter . select
5454 end
5555
6060
6161 it 'warns polling fallback with custom message if set' do
6262 expected_msg = "[Listen warning]:\n custom fallback message"
63- expect ( Kernel ) . to receive ( :warn ) . with ( expected_msg )
63+ expect ( Listen ) . to receive ( :adapter_warn ) . with ( expected_msg )
6464 msg = 'custom fallback message'
6565 Listen ::Adapter . select ( polling_fallback_message : msg )
6666 end
You can’t perform that action at this time.
0 commit comments