Module: Listen::Adapter

Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/bsd.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/base.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/linux.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/config.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/polling.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter/windows.rb

Defined Under Namespace

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

Constant Summary collapse

OPTIMIZED_ADAPTERS =
[Darwin, Linux, BSD, Windows].freeze
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



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/listen-3.8.0/lib/listen/adapter.rb', line 17

def select(options = {})
  Listen.logger.debug 'Adapter: considering polling ...'
  return Polling if options[:force_polling]
  Listen.logger.debug 'Adapter: considering optimized backend...'
  return _usable_adapter_class if _usable_adapter_class
  Listen.logger.debug 'Adapter: falling back to polling...'
  _warn_polling_fallback(options)
  Polling
rescue
  Listen.logger.warn format('Adapter: failed: %s:%s', $ERROR_POSITION.inspect,
                            $ERROR_POSITION * "\n")
  raise
end