Module: Coyote::FSListeners

Defined in:
lib/coyote/fs_listeners.rb,
lib/coyote/fs_listeners/base.rb,
lib/coyote/fs_listeners/linux.rb,
lib/coyote/fs_listeners/darwin.rb,
lib/coyote/fs_listeners/polling.rb,
lib/coyote/fs_listeners/windows.rb

Defined Under Namespace

Classes: Base, Darwin, Linux, Polling, Windows

Class Method Summary collapse

Class Method Details

.chooseObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/coyote/fs_listeners.rb', line 17

def self.choose
  if mac? && Darwin.usable?
    Darwin.new
  elsif linux? && Linux.usable?
    Linux.new
  elsif windows? && Windows.usable?
    Windows.new
  else
    notify "Using polling (Please help us to support your system better than that.)", :failure
    Polling.new
  end
end

.linux?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/coyote/fs_listeners.rb', line 34

def self.linux?
  Config::CONFIG['target_os'] =~ /linux/i
end

.mac?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/coyote/fs_listeners.rb', line 30

def self.mac?
  Config::CONFIG['target_os'] =~ /darwin/i
end

.windows?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/coyote/fs_listeners.rb', line 38

def self.windows?
  Config::CONFIG['target_os'] =~ /mswin|mingw/i
end