Guard::Windows

Listener implementation for Windows `fchange`.

Public Class Methods

new(*) click to toggle source

Initialize the Listener.

# File lib/guard/listeners/windows.rb, line 9
def initialize(*)
  super
  @fchange = FChange::Notifier.new
end
usable?(no_vendor = false) click to toggle source

Check if the listener is usable on the current OS.

@return [Boolean] whether usable or not

# File lib/guard/listeners/windows.rb, line 32
def self.usable?(no_vendor = false)
  return false unless RbConfig::CONFIG['target_os'] =~ /mswin|mingw/

  $LOAD_PATH << File.expand_path('../../../vendor/windows/lib', __FILE__) unless no_vendor
  require 'rb-fchange'
  true
rescue LoadError
  false
end

Public Instance Methods

start() click to toggle source

Start the listener.

# File lib/guard/listeners/windows.rb, line 16
def start
  super
  worker.run
end
stop() click to toggle source

Stop the listener.

# File lib/guard/listeners/windows.rb, line 23
def stop
  super
  worker.stop
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.