Class: Guard::Linux
Overview
Listener implementation for Linux ‘inotify`.
Constant Summary
Constants inherited from Listener
Guard::Listener::DEFAULT_IGNORE_PATHS
Instance Attribute Summary
Attributes inherited from Listener
#changed_files, #directory, #ignore_paths
Class Method Summary collapse
-
.usable?(no_vendor = false) ⇒ Boolean
Check if the listener is usable on the current OS.
Instance Method Summary collapse
-
#initialize ⇒ Linux
constructor
Initialize the Listener.
-
#start ⇒ Object
Start the listener.
-
#stop ⇒ Object
Stop the listener.
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
Class Method Details
permalink .usable?(no_vendor = false) ⇒ Boolean
Check if the listener is usable on the current OS.
35 36 37 38 39 40 41 |
# File 'lib/guard/listeners/linux.rb', line 35 def self.usable?(no_vendor = false) $LOAD_PATH << File.('../../../vendor/linux/lib', __FILE__) unless no_vendor require 'rb-inotify' true rescue LoadError false end |
Instance Method Details
permalink #start ⇒ Object
Start the listener.
18 19 20 21 22 |
# File 'lib/guard/listeners/linux.rb', line 18 def start @stop = false super watch_change unless watch_change? end |
permalink #stop ⇒ Object
Stop the listener.
26 27 28 29 |
# File 'lib/guard/listeners/linux.rb', line 26 def stop super @stop = true end |