Sha256: 7ddaf7e8bae4b3da2dd0660cb46f237726d8bd20244d432857f9d2a4384ccf90

Contents?: true

Size: 926 Bytes

Versions: 67

Compression:

Stored size: 926 Bytes

Contents

require 'rubygems'
require 'autotest'
require 'sys/uname'

include Sys

##
# Autotest::FSEvent
#
# == FEATUERS:
# * Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling
#
# == SYNOPSIS:
# ~/.autotest
#   require 'autotest/fsevent'
module Autotest::FSEvent

  GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) unless defined?(GEM_PATH)

  ##
  # Use FSEvent if possible 
  # Add waiting hook to prevent fallback to polling after ignored files have changed
  if Uname.sysname == 'Darwin' && Uname.release.to_i >= 9
    Autotest.add_hook :initialize do
      class ::Autotest
        remove_method :wait_for_changes
        def wait_for_changes
          hook :waiting
          begin
            `cd '#{Dir.pwd}'; #{File.join(GEM_PATH, 'bin', 'fsevent_sleep')} . 2>&1`
            Kernel.sleep self.sleep
          end until find_files_to_test
        end
      end
    end
  end

end

Version data entries

67 entries across 67 versions & 5 rubygems

Version Path
autotest-fsevent-0.2.22 lib/autotest/fsevent.rb
cloudsmith-api-2.0.16 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
cloudsmith-api-2.0.13 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
cloudsmith-api-2.0.12 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
cloudsmith-api-2.0.11 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
cloudsmith-api-2.0.10 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
cloudsmith-api-2.0.9 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
cloudsmith-api-2.0.8 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/lib/autotest/fsevent.rb
autotest-fsevent-0.2.21 lib/autotest/fsevent.rb
cloudsmith-api-2.0.7 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/lib/autotest/fsevent.rb
cloudsmith-api-2.0.6 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/lib/autotest/fsevent.rb
cloudsmith-api-2.0.5 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/lib/autotest/fsevent.rb
cloudsmith-api-2.0.4 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/lib/autotest/fsevent.rb
cloudsmith-api-2.0.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/lib/autotest/fsevent.rb
cloudsmith-api-2.0.2 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/lib/autotest/fsevent.rb
cloudsmith-api-2.0.1 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/lib/autotest/fsevent.rb
cloudsmith-api-2.0.0 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/lib/autotest/fsevent.rb
autotest-fsevent-0.2.20 lib/autotest/fsevent.rb