rooster 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,9 +19,11 @@ module Rooster
19
19
  run
20
20
  end
21
21
 
22
+ private
23
+
22
24
  def run
23
25
  while @minutes > 0
24
- puts "\"#{@text}\" in #{@minutes} minutes"
26
+ puts "#{@minutes} minute remaining until \"#{@text}\""
25
27
  sleep ONE_MINUTE
26
28
  @minutes -= 1
27
29
  end
@@ -29,17 +31,31 @@ module Rooster
29
31
  end
30
32
 
31
33
  def alarm
32
- `tput bel` if can_tput
33
- TerminalNotifier.notify @text, :title => 'Egg Timer'
34
- puts @text
34
+ beep_it
35
+ say_it
36
+ notification_center_it
37
+ display_it
35
38
  end
36
39
 
37
- protected
38
-
39
- def can_tput
40
+ def beep_it
40
41
  `which tput`
41
- $?.success?
42
+ `tput bel` if $?.success?
42
43
  end
44
+
45
+ def say_it
46
+ `which say`
47
+ `say #{@text}` if $?.success?
48
+ end
49
+
50
+ def notification_center_it
51
+ TerminalNotifier.notify @text, :title => 'Egg Timer'
52
+ end
53
+
54
+ def display_it
55
+ puts "\nTime's up."
56
+ puts "\"#{@text}\""
57
+ end
58
+
43
59
  end
44
60
 
45
61
  end
@@ -1,3 +1,3 @@
1
1
  module Rooster
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rooster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-23 00:00:00.000000000 Z
12
+ date: 2013-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler