Guard::Darwin

Listener implementation for Mac OS X `FSEvents`.

Public Class Methods

new(*) click to toggle source

Initialize the Listener.

# File lib/guard/listeners/darwin.rb, line 9
def initialize(*)
  super
  @fsevent = FSEvent.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/darwin.rb, line 32
def self.usable?(no_vendor = false)
  return false unless RbConfig::CONFIG['target_os'] =~ /darwin/

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

Public Instance Methods

start() click to toggle source

Start the listener.

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

Stop the listener.

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.