Module: FSSM::Support

Defined in:
lib/fssm/support.rb

Class Method Summary collapse

Class Method Details

.backendObject



3
4
5
# File 'lib/fssm/support.rb', line 3

def backend
  (mac? && carbon_core?) ? 'FSEvents' : 'Polling'
end

.carbon_core?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
# File 'lib/fssm/support.rb', line 11

def carbon_core?
  @@carbon_core ||= begin
    require 'osx/foundation'
    OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework'
    true
  rescue LoadError
    false
  end
end

.mac?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/fssm/support.rb', line 7

def mac?
  @@mac ||= RUBY_PLATFORM =~ /darwin/i
end