Skip to content

RobertLowe/autotest-fsevent

 
 

Repository files navigation

Autotest FSEvent

DESCRIPTION:

Autotest relies on filesystem polling to detect modifications in source code files. In other words: The filesytem is constantly being traversed which causes quite some load on both the CPU and the harddrive. This is not healthy for your Mac and if you are working on a portable computer, it will drain your battery. Apple has introduces FSEvent with Mac OS X 10.5 which is a very efficient way to have the operating system monitor file alterations. This gem teaches autotest to use FSEvent and therefore be nice to your Mac.

Unlike other test runners for the Mac, autotest-mac does not replace but extend autotest and does not require RubyCocoa to be installed.

If you are on Linux, you should take a look at the autotest-inotify gem instead:

github.com/ewollesen/autotest-inotify

REQUIREMENTS:

  • Mac OS X >= 10.5

  • Xcode

  • any ZenTest compatible test suite

  • sys-uname

INSTALL:

In order to compile the fsevent binary at install time, Xcode (Mac OS X Development Suite) must be installed. You can download it for free from:

developer.apple.com

Furthermore, you have to decide whether you want to use the comprehensive ZenTest gem or the lightweight autotest-standalone gem and install either of them. (See “Autotest” below for more on this.)

sudo gem install ZenTest   --OR--
sudo gem install autotest-standalone

Now install the gem:

sudo gem install autotest-fsevent

Then add the following line *after all other requires* in your ~/.autotest file:

require 'autotest/fsevent'

If you like this gem, please consider to recommend me on Working with Rails, thank you!

workingwithrails.com/recommendation/new/person/11706-sven-schwyn

AUTOTEST:

You can use any ZenTest-compatible test suite with this gem, which basically boils down to either of the following two sets of gems.

Comprehensive test suite by Ryan Davis:

  • ZenTest

  • autotest-rails (for Ruby on Rails compatibility)

Lightweight test suite by Michael Grosser:

  • autotest-standalone

  • autotest-rails-pure (for Ruby on Rails compatibility)

  • zentest-without-autotest (for full ZenTest compatibility)

Note: Due to a naming disagreement, starting from version 4.4.6 the autotest gem is no longer a lightweight fork but only an empty gem which requires ZenTest. Switch to the autotest-standalone gem if you want to stick with the lightweight approach.

TROUBLESHOOTING:

Autotest Binary Not Present

Make sure you have either the ZenTest gem or the autotest-standalone gem installed. This dependency has been dropped as of autotest-fsevent-0.2.3 in order to allow any compatible test suite.

Compilation of fsevent_sleep Failed

Make sure you have Xcode (Mac OS X Development Suite) installed. You can download it for free from:

developer.apple.com

DEVELOPMENT:

You can install the bleeding edge version as follows:

git clone git://github.com/svoop/autotest-fsevent.git
cd autotest-fsevent
bundle install
rake build
rake install

Please submit issues on:

forge.bitcetera.com/projects/show/autotest-fsevent

To contribute code, fork the project on Github, add your code and submit a pull request:

github.com/guides/fork-a-project-and-submit-your-modifications

CONTRIBUTIONS:

Thanks to the following folks who have contributed to this project:

  • Harry Vangberg

  • Darrick Wiebe

  • Sean DeNigris

  • Cyril Mougel

LICENSE:

(The MIT License)

Copyright © 2010 Sven Schwyn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Use FSEvent (Mac OS X 10.5 or higher) instead of filesystem polling.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 76.2%
  • C 23.8%