From b63e82081f482b2732e03dd3262391b95fba1d1d Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 25 Aug 2013 23:35:15 -0400 Subject: [PATCH] Add mac notifications --- Gemfile | 1 + Gemfile.lock | 2 ++ Guardfile | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 461ea69..1c61629 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,7 @@ group :test, :development do gem 'capybara-webkit' gem 'guard-rspec' gem 'libnotify', :require => linux_only('libnotify') + gem 'terminal-notifier-guard', :require => darwin_only('terminal-notifier-guard') gem 'rb-fsevent' gem 'database_cleaner', '1.0.1' gem 'coveralls', require: false diff --git a/Gemfile.lock b/Gemfile.lock index ec9d270..58071e6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -175,6 +175,7 @@ GEM activesupport (>= 3.0) sprockets (~> 2.8) sqlite3 (1.3.7) + terminal-notifier-guard (1.5.3) thin (1.5.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) @@ -218,6 +219,7 @@ DEPENDENCIES sass-rails (~> 4.0.0) sdoc sqlite3 + terminal-notifier-guard thin uglifier (>= 1.3.0) validates_timeliness (~> 3.0) diff --git a/Guardfile b/Guardfile index a99de8d..2c4e1bd 100644 --- a/Guardfile +++ b/Guardfile @@ -2,7 +2,12 @@ # More info at https://github.com/guard/guard#readme guard :rspec do - notification :libnotify, :timeout => 5, :transient => true, :append => false, :urgency => :critical + if RUBY_PLATFORM.include?('linux') + notification :libnotify, :timeout => 5, :transient => true, :append => false, :urgency => :critical + end + if RUBY_PLATFORM.include?('darwin') + notification :terminal_notifier, :timeout => 5 + end watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }