Class: Listen::Adapter::Windows

Inherits:
Base
  • Object
show all
Defined in:
lib/listen/adapter/windows.rb

Overview

Adapter implementation for Windows ‘wdm`.

Constant Summary collapse

OS_REGEXP =
/mswin|mingw|cygwin/i.freeze
BUNDLER_DECLARE_GEM =
<<-EOS.gsub(/^ {6}/, '')
  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
EOS

Constants inherited from Base

Base::DEFAULTS

Instance Attribute Summary

Attributes inherited from Base

#config, #options

Class Method Summary collapse

Methods inherited from Base

#configure, #initialize, #start, #started?, #stop

Constructor Details

This class inherits a constructor from Listen::Adapter::Base

Class Method Details

.usable?Boolean

Returns:

  • (Boolean)


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

def self.usable?
  return false unless super
  require 'wdm'
  true
rescue LoadError
  Listen.logger.debug format('wdm - load failed: %s:%s', $ERROR_INFO,
                             $ERROR_POSITION * "\n")

  Listen.adapter_warn(BUNDLER_DECLARE_GEM)
  false
end