Class: SassListen::Adapter::Darwin

Inherits:
Base
  • Object
show all
Defined in:
lib/sass-listen/adapter/darwin.rb

Overview

Adapter implementation for Mac OS X `FSEvents`.

Constant Summary collapse

OS_REGEXP =
/darwin(?<major_version>1\d+)/i
DEFAULTS =

The default delay between checking for changes.

{ latency: 0.1 }
INCOMPATIBLE_GEM_VERSION =
<<-EOS.gsub(/^ {8}/, '')
  rb-fsevent > 0.9.4 no longer supports OS X 10.6 through 10.8.

  Please add the following to your Gemfile to avoid polling for changes:
    require 'rbconfig'
    if RbConfig::CONFIG['target_os'] =~ /darwin(1[0-3])/i
      gem 'rb-fsevent', '<= 0.9.4'
    end
EOS

Instance Attribute Summary

Attributes inherited from Base

#config, #options

Class Method Summary collapse

Methods inherited from Base

#configure, #initialize, #start, #started?, #stop

Constructor Details

This class inherits a constructor from SassListen::Adapter::Base

Class Method Details

.usable?Boolean

Returns:

  • (Boolean)

24
25
26
27
28
29
30
31
# File 'lib/sass-listen/adapter/darwin.rb', line 24

def self.usable?
  require 'rb-fsevent'
  darwin_version = RbConfig::CONFIG['target_os'][OS_REGEXP, :major_version] or return false
  return true if darwin_version.to_i >= 13 # darwin13 is OS X 10.9
  return true if Gem::Version.new(FSEvent::VERSION) <= Gem::Version.new('0.9.4')
  Kernel.warn INCOMPATIBLE_GEM_VERSION
  false
end