Created
January 31, 2011 15:25
-
-
Save neocsr/804183 to your computer and use it in GitHub Desktop.
Autotest with Ruby 1.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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