Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added ability to still submit tasks to onething if you don't have gro…

…wl install or your OS doesn't support it
  • Loading branch information...
commit 20d92f7a3063b7a7f560e4f0b0a40ddce1b06517 1 parent 2a05ab2
@mgornick authored
Showing with 18 additions and 8 deletions.
  1. +14 −5 lib/config.rb
  2. +4 −3 start.rb
View
19 lib/config.rb
@@ -2,11 +2,20 @@
require 'erb'
require 'yaml'
-# setup growl notifications
-GrowlNotify.config do |config|
- config.notifications = ["OneThingApp", "Daily Things"]
- config.default_notifications = ["OneThingApp"]
- config.application_name = "OneThngApp" #this shows up in the growl applications list in systems settings
+
+
+begin
+ # setup growl notifications
+ GrowlNotify.config do |config|
+ config.notifications = ["OneThingApp", "Daily Things"]
+ config.default_notifications = ["OneThingApp"]
+ config.application_name = "OneThngApp" #this shows up in the growl applications list in systems settings
+ end
+
+ GROWL_SUPPORT = true
+rescue
+ # growl is not supported on this computer or OS
+ GROWL_SUPPORT = false
end
# load username and password from /config/credentials.yml
View
7 start.rb
@@ -10,7 +10,6 @@
tasks = Task.find(:all)
task = tasks.first
-
if ARGV[0]
# set the current one thing for today
description = ARGV[0] || "test"
@@ -27,8 +26,10 @@
Task.create(:description => description)
end
- timer = Timer.new(description)
- timer.save
+ if GROWL_SUPPORT
+ timer = Timer.new(description)
+ timer.save
+ end
else
# view the past 3 one things
tasks = Task.find(:all)
Please sign in to comment.
Something went wrong with that request. Please try again.