Guest User

Untitled

a guest
Feb 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. Autotest.send(:alias_method, :real_make_test_cmd, :make_test_cmd)
  2. Autotest.send(:define_method, :make_test_cmd) do |*args|
  3. real_make_test_cmd(*args).sub('test/unit', %[rubygems -e "require 'redgreen'"])
  4. end
  5.  
  6. module Autotest::Growl
  7. def self.growl title, msg, pri=0, stick=""
  8. system "growlnotify -n autotest --image /opt/local/lib/ruby/gems/1.8/gems/rails-1.1.6/html/images/rails.png -p #{pri} -m #{msg.inspect} #{title} #{stick}"
  9. end
  10.  
  11. Autotest.add_hook :ran_command do |at|
  12. output = at.results.slice(/(\d+).*errors/)
  13. if output =~ /ns.*[1-9]/
  14. growl "Test Results", "#{output}"[3..-1], 2, "-s"
  15. else
  16. growl "Test Results", "#{output}"[3..-1]
  17. end
  18. end
  19. end
Add Comment
Please, Sign In to add comment