Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
If growlnotify not available, output with puts.
Browse files Browse the repository at this point in the history
This allows using watchr to run the tests on e.g. Linux.
  • Loading branch information
Ilkka Laukkanen authored and nesquena committed Feb 28, 2011
1 parent c9f7839 commit 203ab82
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test.watchr
Expand Up @@ -3,10 +3,14 @@ system 'clear'

def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
image = message.include?('0 failures, 0 errors') ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
if not growlnotify.empty?
title = "Watchr Test Results"
image = message.include?('0 failures, 0 errors') ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
else
puts message
end
end

def run(cmd)
Expand Down Expand Up @@ -67,4 +71,4 @@ Signal.trap 'INT' do
# raise Interrupt, nil # let the run loop catch it
run_suite
end
end
end

1 comment on commit 203ab82

@achiurizo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikka, thanks for the changes!

@nesquena thanks for pulling the changes in!

Please sign in to comment.