Module: Driskell::Listen::Adapter

Defined in:
lib/driskell-listen/adapter.rb,
lib/driskell-listen/adapter/bsd.rb,
lib/driskell-listen/adapter/base.rb,
lib/driskell-listen/adapter/linux.rb,
lib/driskell-listen/adapter/config.rb,
lib/driskell-listen/adapter/darwin.rb,
lib/driskell-listen/adapter/polling.rb,
lib/driskell-listen/adapter/windows.rb,
lib/driskell-listen/adapter/simulated_darwin.rb

Defined Under Namespace

Classes: BSD, Base, Config, Darwin, Linux, Polling, SimulatedDarwin, Windows

Constant Summary collapse

OPTIMIZED_ADAPTERS =
[Darwin, SimulatedDarwin, Linux, BSD, Windows]
POLLING_FALLBACK_MESSAGE =
'Listen will be polling for changes.'\
'Learn more at https://github.com/guard/listen#listen-adapters.'

Class Method Summary collapse

Class Method Details

.select(options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/driskell-listen/adapter.rb', line 15

def self.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: falling back to polling...'
  _warn_polling_fallback(options)
  Polling
rescue
  _log :warn, format('Adapter: failed: %s:%s', $ERROR_POSITION.inspect,
                     $ERROR_POSITION * "\n")
  raise
end