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

BUNDLER_DECLARE_GEM =

The message to show when wdm gem isn’t available

"  Please add the following to your Gemfile to avoid polling for changes:\n    require 'rbconfig'\n    gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i\n".gsub(/^ {6}/, '')

Constants inherited from Base

Base::DEFAULT_LATENCY

Instance Attribute Summary

Attributes inherited from Base

#listener

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Class Method Details

.usable?Boolean

Returns:

  • (Boolean)


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

def self.usable?
  if RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i
    require 'wdm'
    true
  end
rescue Gem::LoadError
  Kernel.warn BUNDLER_DECLARE_GEM
end

Instance Method Details

#startObject



25
26
27
28
# File 'lib/listen/adapter/windows.rb', line 25

def start
  worker = _init_worker
  worker.run!
end