PCS_pomodoro 0.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/PCS_pomodoro.rb +34 -0
  3. metadata +46 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3a71aad0129c3ecfa1011c06f738c73f2f2e3ec1
4
+ data.tar.gz: ea9174691acbf40b13656630fb406f48ccc468c1
5
+ SHA512:
6
+ metadata.gz: 5927f481357f8485462d96a9d320da43f1b9a99a2bb47d2ba12f9f129beb5263c763bea57f01a8142a64fb5b86a6b65773f557e31b9ba247bb838e9d5997672d
7
+ data.tar.gz: 573233fa760111b3cfe7628d3cea75072c4de7fc46272c284d2949ea6df52d055a0bb6a518ae73ffe181c40bf13087cb165d7e4fc3cab70c335ec8d1c1e2cbda
@@ -0,0 +1,34 @@
1
+ require 'terminal-notifier'
2
+
3
+ class Pomodoro
4
+
5
+ def self.timer(time_in_minutes)
6
+ time_in_seconds = time_in_minutes * 60
7
+
8
+ if time_in_seconds > 0
9
+ notify("Your Timer: #{time_in_minutes} minute.")
10
+ sleep(time_in_seconds-(time_in_seconds/10))
11
+ notify("Your time is almost up. #{time_in_seconds/10} seconds left.")
12
+ sleep(time_in_seconds/10)
13
+ notify("Your time is up. Take a break.")
14
+ else
15
+ puts "I am already awake."
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def self.notify(msg)
22
+ TerminalNotifier.notify('', :title => "#{msg}", :subtitle => 'Pomodoro-Timer')
23
+ end
24
+
25
+ end
26
+
27
+ Pomodoro.timer(5)
28
+
29
+ # To run in background
30
+ # In iterm
31
+
32
+ # => nohup ruby timer.rb &
33
+
34
+ # timer must be set within program. cannot take external arguments.
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: PCS_pomodoro
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Greg Larrenaga
8
+ - Colette Pitamba
9
+ - Neil Northrom
10
+ - Patrick Mounts
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2013-06-11 00:00:00.000000000 Z
15
+ dependencies: []
16
+ description: times 25 minutes then times 3 minute breaks.
17
+ email: ''
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/PCS_pomodoro.rb
23
+ homepage: https://github.com/Duder-onomy/Pomodoro_Timer.git
24
+ licenses: []
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.0.3
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: pomodoro timer to help keep your attention.
46
+ test_files: []