Module: AutotestMac

Defined in:
lib/autotest-mac.rb

Constant Summary collapse

VERSION =
'0.1.0'
GEM_DIR =
File.expand_path(File.join(File.dirname(__FILE__), '..'))

Instance Method Summary collapse

Instance Method Details

#initializeObject

Add some exceptions



75
76
77
# File 'lib/autotest-mac.rb', line 75

Autotest.add_hook :initialize do |autotest|
    %w{.svn .hg .git vendor}.each {|exception| autotest.add_exception(exception) }
end

#waitingObject

Use FSEvent if possible



81
82
83
84
85
86
87
# File 'lib/autotest-mac.rb', line 81

Autotest.add_hook :waiting do |autotest|
  if RUBY_PLATFORM.sub(/^.*?darwin(\d+)$/, '\1').to_i >= 9   # Darwin 9 alias Mac OS X 10.5 or above only
    `#{File.join(GEM_DIR, 'fsevent', 'fsevent_sleep')} '#{Dir.pwd}' 2>&1`
  else
    puts "\nautotest-mac: FSEvent not available, falling back to filesystem polling."
  end
end