Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6 from benedmunds/master

Add NotificationCenter support if available
  • Loading branch information...
commit 732a4d0517f0762bd348ebf74d9d73b639a9d6e4 2 parents 9ca0be4 + ced4790
@steveklabnik authored
Showing with 12 additions and 2 deletions.
  1. +11 −2 lib/pomodoro.rb
  2. +1 −0  pomodoro.gemspec
View
13 lib/pomodoro.rb
@@ -2,6 +2,7 @@
require "bundler/setup"
require 'sinatra'
require 'noprocrast'
+require 'terminal-notifier'
module Pomodoro
class << self
@@ -28,11 +29,19 @@ def work
end
def break_growl
- system 'growlnotify -w -n Pomodoro -m "You have 5 minutes." "BREAK TIME"'
+ if (TerminalNotifier.available?) then
+ TerminalNotifier.notify('You have 5 minutes.', :title => 'Pomodoro', :subtitle => 'BREAK TIME')
+ else
+ system 'growlnotify -w -n Pomodoro -m "You have 5 minutes." "BREAK TIME"'
+ end
end
def work_growl
- system 'growlnotify -w -n Pomodoro -m "This lasts 25 minutes." "WORK TIME"'
+ if (TerminalNotifier.available?) then
+ TerminalNotifier.notify('This lasts 25 minutes.', :title => 'Pomodoro', :subtitle => 'WORK TIME')
+ else
+ system 'growlnotify -w -n Pomodoro -m "This lasts 25 minutes." "WORK TIME"'
+ end
end
end
View
1  pomodoro.gemspec
@@ -20,4 +20,5 @@ Gem::Specification.new do |s|
s.add_dependency("noprocrast")
s.add_dependency("thin")
s.add_dependency("sinatra")
+ s.add_dependency("terminal-notifier")
end
Please sign in to comment.
Something went wrong with that request. Please try again.