Class: Guard::Windows

Inherits:
Listener show all
Defined in:
lib/guard/listeners/windows.rb

Overview

Listener implementation for Windows ‘fchange`.

Constant Summary

Constants inherited from Listener

Listener::DEFAULT_IGNORE_PATHS

Instance Attribute Summary

Attributes inherited from Listener

#changed_files, #directory, #ignore_paths

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Listener

#all_files, #clear_changed_files, #exclude_ignored_paths, #modified_files, #on_change, #pause, #paused?, #relativize_paths, #relativize_paths?, #run, select_and_init, #start_reactor, #timestamp_files, #update_last_event

Constructor Details

#initializeWindows

Initialize the Listener.



9
10
11
12
# File 'lib/guard/listeners/windows.rb', line 9

def initialize(*)
  super
  @fchange = FChange::Notifier.new
end

Class Method Details

.usable?(no_vendor = false) ⇒ Boolean

Check if the listener is usable on the current OS.

Returns:

  • (Boolean)

    whether usable or not



32
33
34
35
36
37
38
# File 'lib/guard/listeners/windows.rb', line 32

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

Instance Method Details

#startObject

Start the listener.



16
17
18
19
# File 'lib/guard/listeners/windows.rb', line 16

def start
  super
  worker.run
end

#stopObject

Stop the listener.



23
24
25
26
# File 'lib/guard/listeners/windows.rb', line 23

def stop
  super
  worker.stop
end