dmitryame / preallowed

Distributed Role-Based Access Control Service -- Restful authorization

This URL has Read+Write access

preallowed / .autotest
100644 25 lines (18 sloc) 0.73 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'autotest/timestamp'
 
Autotest.send(:alias_method, :real_make_test_cmd, :make_test_cmd)
Autotest.send(:define_method, :make_test_cmd) do |*args|
  real_make_test_cmd(*args).sub('test/unit', %[rubygems -e "require 'redgreen'"])
end
 
 
 
module Autotest::Growl
  def self.growl title, msg, img, pri=0, stick=""
    system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{stick}"
  end
 
  Autotest.add_hook :ran_command do |at|
    output = at.results.last.slice(/(\d+).*errors/)
    if output =~ /ns.*[1-9]/
      growl "Test Results", "#{output}", './public/images/rails_fail.png', 2 #, "-s"
    else
      growl "Test Results", "#{output}", './public/images/rails_ok.png'
    end
  end
end