Skip to content

Commit

Permalink
TEMP: Add debug output for JRuby adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
floehopper committed Aug 7, 2019
1 parent 6fb459e commit 5acaaeb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ matrix:
# TODO: 0.8 is enough on Linux, but 2 seems needed for Travis/OSX
- LISTEN_TESTS_DEFAULT_LAG=2
- rvm: jruby
env:
- LISTEN_TESTS_DEFAULT_LAG=10
- TEST_LISTEN_ADAPTER_MODES=native
- LISTEN_GEM_DEBUGGING=2
- rvm: truffleruby
- rvm: jruby-head
- rvm: ruby-head
Expand Down
6 changes: 5 additions & 1 deletion lib/listen/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ def select(options = {})
_log :debug, 'Adapter: considering polling ...'
return Polling if options[:force_polling]
_log :debug, 'Adapter: considering optimized backend...'
return _usable_adapter_class if _usable_adapter_class
_log :debug, "Adapter: RUBY_ENGINE=#{RUBY_ENGINE}"
if _usable_adapter_class
_log :debug, "Adapter: using #{_usable_adapter_class}"
return _usable_adapter_class
end
_log :debug, 'Adapter: falling back to polling...'
_warn_polling_fallback(options)
Polling
Expand Down
1 change: 1 addition & 0 deletions lib/listen/adapter/jruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def _configure(directory, &_callback)
]

@watcher ||= FileSystems.getDefault.newWatchService
p @watcher.class.name
@keys ||= {}
path = Paths.get(directory.to_s)
key = path.register(@watcher, *event_kinds)
Expand Down

0 comments on commit 5acaaeb

Please sign in to comment.