Skip to content

Instantly share code, notes, and snippets.

@neocsr
Created January 31, 2011 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neocsr/804183 to your computer and use it in GitHub Desktop.
Save neocsr/804183 to your computer and use it in GitHub Desktop.
Autotest with Ruby 1.9
# AUTOTEST config file by @neocsr
# ~/.autotest
def check_and_require_gem(name,with_require)
eval %[if (Gem.available?('#{name}')); require '#{with_require}'; else; puts "#"*40; puts "# Gem '#{name}' not found."; puts "#"*40; end]
end
# Don't use RedGreen with Ruby 1.9 due to MiniTest replacement of UnitTest
if ENV["RSPEC"] || (RUBY_VERSION =~ /1\.9/)
check_and_require_gem('turn','turn')
check_and_require_gem('test_notifier', 'test_notifier/runner/autotest')
PLATFORM = RUBY_PLATFORM unless defined? PLATFORM
else
check_and_require_gem('redgreen','redgreen/autotest')
check_and_require_gem('autotest-growl','autotest/growl')
end
# Filter out non related files
Autotest.add_hook :initialize do |autotest|
%w{.git .svn .hg .DS_Store ._* vendor tmp log doc}.each do |exception|
autotest.add_exception(exception)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment