reminder 0.0.1rc → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,6 +11,7 @@ This is how it looks like
11
11
 
12
12
  That way, the Growl notification will notice (bother) me and remind (make) me commit.
13
13
 
14
+ You'll need Growl Notify to use this gem. Download it [here](http://growl.info)
14
15
 
15
16
  Options
16
17
  =======
data/bin/reminder CHANGED
@@ -5,16 +5,14 @@ require 'growl'
5
5
  require 'choice'
6
6
 
7
7
  Choice.options do
8
- banner "Usage: #{File.basename(__FILE__)} [-mtT]"
8
+ banner "Usage: #{File.basename(__FILE__)} [-m]"
9
9
  header ''
10
10
  header 'Notification Options:'
11
11
 
12
12
  option :message do
13
- d = "How's it going you awesome person?"
14
13
  short '-m'
15
14
  long '--message=MESSAGE'
16
- desc "The notification message. The reminder! (default #{d})"
17
- default d
15
+ desc "The notification message. The reminder!"
18
16
  end
19
17
 
20
18
  option :title do
@@ -49,5 +47,8 @@ Choice.options do
49
47
  end
50
48
 
51
49
  options = Choice.choices
52
-
53
- Reminder::Notifier.new(options).run
50
+ begin
51
+ Reminder::Notifier.new(options).run
52
+ rescue Exception => e
53
+ puts e.message
54
+ end
@@ -2,13 +2,27 @@ module Reminder
2
2
  class Error < StandardError ; end
3
3
 
4
4
 
5
+ # This exception will be raised if Growl is not installed
6
+ # You'll need to install Growl to use this gem
7
+ class NoMessageException < Error
8
+ attr_writer :default_message
9
+ def initialize(message = nil)
10
+ @message = message
11
+ @default_message = "Usage: $ reminder -m 'My message'\nrun reminder --help for more information"
12
+ end
13
+ def to_s
14
+ @message || @default_message
15
+ end
16
+ end
17
+
18
+
5
19
  # This exception will be raised if Growl is not installed
6
20
  # You'll need to install Growl to use this gem
7
21
  class GrowlNotInstalled < Error
8
22
  attr_writer :default_message
9
23
  def initialize(message = nil)
10
24
  @message = message
11
- @default_message = "Growl is not installed. Download it at http://growl.info"
25
+ @default_message = "Growl Notify is not installed. Download it at http://growl.info"
12
26
  end
13
27
  def to_s
14
28
  @message || @default_message
@@ -6,6 +6,7 @@ module Reminder
6
6
  @message = options[:message]
7
7
  @title = options[:title]
8
8
  @time = options[:time]
9
+ raise NoMessageException and return if @message.nil?
9
10
  end
10
11
 
11
12
  def run
@@ -1,3 +1,3 @@
1
1
  module Reminder
2
- VERSION = "0.0.1rc"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reminder
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 5
5
- version: 0.0.1rc
4
+ prerelease:
5
+ version: 1.0.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Nicol\xC3\xA1s Hock Isaza"
@@ -69,7 +69,7 @@ extra_rdoc_files: []
69
69
  files:
70
70
  - .gitignore
71
71
  - Gemfile
72
- - README
72
+ - README.md
73
73
  - Rakefile
74
74
  - assets/images/growl.png
75
75
  - bin/reminder
@@ -98,13 +98,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  none: false
100
100
  requirements:
101
- - - ">"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 1.3.1
103
+ version: "0"
104
104
  requirements: []
105
105
 
106
106
  rubyforge_project: reminder
107
- rubygems_version: 1.5.2
107
+ rubygems_version: 1.5.0
108
108
  signing_key:
109
109
  specification_version: 3
110
110
  summary: Simple Growl reminders. Just work, set a timer, and get reminded!