Module: SassListen::Adapter

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

Defined Under Namespace

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

Constant Summary collapse

OPTIMIZED_ADAPTERS =
[Darwin, Linux, BSD, Windows]
POLLING_FALLBACK_MESSAGE =
'SassListen 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



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

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