From e569effdabccb201a62fbc80feaaf569db3cf359 Mon Sep 17 00:00:00 2001 From: Eric Saxby Date: Thu, 29 Nov 2012 16:17:30 -0800 Subject: [PATCH] guard works with growl --- Gemfile | 1 + Gemfile.lock | 2 ++ Guardfile | 10 ++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index ae87a58..3928322 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,4 @@ source "https://rubygems.org" gem "guard-shell" gem 'rb-fsevent', '~> 0.9.1' +gem 'growl' diff --git a/Gemfile.lock b/Gemfile.lock index 28c0a71..72ec7bf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,7 @@ GEM remote: https://rubygems.org/ specs: coderay (1.0.8) + growl (1.0.3) guard (1.5.4) listen (>= 0.4.2) lumberjack (>= 1.0.2) @@ -24,5 +25,6 @@ PLATFORMS ruby DEPENDENCIES + growl guard-shell rb-fsevent (~> 0.9.1) diff --git a/Guardfile b/Guardfile index bef33c3..24ee5d4 100644 --- a/Guardfile +++ b/Guardfile @@ -4,7 +4,13 @@ # Add files and commands to this file, like the example: # watch(%r{file/path}) { `command(s)` } # -guard 'shell' do - watch(/(.*).c/) {|m| `make` } +guard 'shell', all_on_start: true do + watch(/(.*).c$/) do |m| + if system("make") + n "#{m[0]} valid", "Make succeeded", :success + else + n "Error in #{m[0]}", "Make failed", :failed + end + end watch(/Makefile/) {|m| `make` } end