jodosha (owner)

Revisions

gist: 90060 Download_button fork
public
Public Clone URL: git://gist.github.com/90060.git
Embed All Files: show embed
.autotest #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Autotest::Growl
  Autotest.add_hook :ran_command do |at|
    output = at.results.last.slice(/(\d+).*(failure|error)/).gsub(/31m/, "")
    if output !~ /\s0\s/
      status, priority = "fail", "High"
    else
      status, priority = "pass", "Normal"
    end
    image_dir = "~/Library/autotest"
    growl_notify status, "Test Results", output, "#{image_dir}/rails_#{status}.p
ng", priority #, ā€œ-sā€
  end
 
  def self.growl_notify status, title, msg, img, pri=0, stick=""
    system "growlnotify -n autotest_#{status} --image #{img} -p #{pri} -m #{msg.
inspect} #{title} #{stick}"
  end
end