pomo 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CONTRIBUTING.md +20 -0
- data/HISTORY.md +6 -0
- data/README.md +1 -8
- data/lib/pomo.rb +8 -6
- data/lib/pomo/configuration.rb +5 -27
- data/lib/pomo/notifier.rb +5 -5
- data/lib/pomo/notifier/{growl.rb → growl_notifier.rb} +1 -1
- data/lib/pomo/notifier/{libnotify.rb → libnotify_notifier.rb} +1 -1
- data/lib/pomo/notifier/{notification_center.rb → notification_center_notifier.rb} +1 -1
- data/lib/pomo/notifier/{quicksilver.rb → quicksilver_notifier.rb} +1 -1
- data/lib/pomo/os.rb +26 -0
- data/lib/pomo/version.rb +1 -1
- metadata +9 -7
data/.gitignore
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
We :heart: pull requests. Here's a quick guide:
|
2
|
+
|
3
|
+
## Contributing
|
4
|
+
|
5
|
+
1. Fork it
|
6
|
+
2. Run the tests and make sure they pass :thumbsup: (`bundle && rake`)
|
7
|
+
3. Add a test for your change
|
8
|
+
4. Make the test pass
|
9
|
+
5. Submit a pull request:
|
10
|
+
* Create your feature branch (`git checkout -b my-new-feature`)
|
11
|
+
* Commit your changes (`git commit -am 'Add some feature'`)
|
12
|
+
* Push to the branch (`git push origin my-new-feature`)
|
13
|
+
* Create new Pull Request
|
14
|
+
|
15
|
+
## Guidelines
|
16
|
+
|
17
|
+
* Include tests that fail without your code, but pass with your code
|
18
|
+
* Follow coding conventions found in the current project
|
19
|
+
* Update the documentation, examples, and/or anything that is
|
20
|
+
affected by your contribution
|
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Pomo
|
1
|
+
# Pomo [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/visionmedia/pomo)
|
2
2
|
|
3
3
|
Command-line application for the [Pomodoro](http://www.pomodorotechnique.com/)
|
4
4
|
time management technique, with notification and tmux status bar support.
|
@@ -180,10 +180,3 @@ and blue during a break e.g.
|
|
180
180
|
|
181
181
|
![tmux status bar](http://i.imgur.com/uIzM3.png)
|
182
182
|
|
183
|
-
## Contributing
|
184
|
-
|
185
|
-
1. Fork it
|
186
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
187
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
188
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
189
|
-
5. Create new Pull Request
|
data/lib/pomo.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
require 'pomo/os'
|
3
|
+
require 'terminal-notifier' if Pomo::OS.mac?
|
4
|
+
require 'growl' if Pomo::OS.mac? || Pomo::OS.windows?
|
5
|
+
require 'libnotify' if Pomo::OS.linux?
|
1
6
|
require 'yaml'
|
2
7
|
require 'octokit'
|
3
|
-
require 'terminal-notifier' if /darwin/ =~ RUBY_PLATFORM
|
4
|
-
require 'growl' if /darwin/ =~ RUBY_PLATFORM
|
5
|
-
require 'libnotify' if /linux/ =~ RUBY_PLATFORM
|
6
8
|
require 'pomo/configuration'
|
7
9
|
require 'pomo/notifier'
|
8
|
-
require 'pomo/notifier/
|
9
|
-
require 'pomo/notifier/
|
10
|
-
require 'pomo/notifier/
|
10
|
+
require 'pomo/notifier/notification_center_notifier'
|
11
|
+
require 'pomo/notifier/growl_notifier'
|
12
|
+
require 'pomo/notifier/libnotify_notifier'
|
11
13
|
require 'pomo/list'
|
12
14
|
require 'pomo/task'
|
13
15
|
require 'pomo/github_task'
|
data/lib/pomo/configuration.rb
CHANGED
@@ -1,14 +1,3 @@
|
|
1
|
-
if RUBY_PLATFORM =~ /darwin/
|
2
|
-
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
|
3
|
-
MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f
|
4
|
-
OS_VERSION = "Mac OS X #{MACOS_FULL_VERSION}"
|
5
|
-
MACOS = true
|
6
|
-
else
|
7
|
-
MACOS_FULL_VERSION = MACOS_VERSION = 0
|
8
|
-
OS_VERSION = RUBY_PLATFORM
|
9
|
-
MACOS = false
|
10
|
-
end
|
11
|
-
|
12
1
|
module Pomo
|
13
2
|
class Configuration
|
14
3
|
##
|
@@ -18,13 +7,6 @@ module Pomo
|
|
18
7
|
|
19
8
|
attr_reader :notifier
|
20
9
|
|
21
|
-
##
|
22
|
-
# Write ~/.pomo_stat file.
|
23
|
-
#
|
24
|
-
# values: true | false
|
25
|
-
|
26
|
-
attr_accessor :pomo_stat
|
27
|
-
|
28
10
|
##
|
29
11
|
# Refresh tmux status bar.
|
30
12
|
#
|
@@ -37,7 +19,6 @@ module Pomo
|
|
37
19
|
def initialize
|
38
20
|
options = {
|
39
21
|
:notifier => default_notifier,
|
40
|
-
:pomo_stat => false,
|
41
22
|
:tmux => false
|
42
23
|
}
|
43
24
|
|
@@ -52,21 +33,18 @@ module Pomo
|
|
52
33
|
end
|
53
34
|
|
54
35
|
@notifier = options[:notifier]
|
55
|
-
@pomo_stat = options[:pomo_stat]
|
56
36
|
@tmux = options[:tmux]
|
57
37
|
end
|
58
38
|
|
59
39
|
private
|
60
40
|
|
61
41
|
def default_notifier
|
62
|
-
if
|
63
|
-
|
64
|
-
|
65
|
-
else
|
66
|
-
return 'growl'
|
67
|
-
end
|
68
|
-
else
|
42
|
+
if Pomo::OS.has_notification_center?
|
43
|
+
return 'notification_center'
|
44
|
+
elsif Pomo::OS.linux?
|
69
45
|
return 'libnotify'
|
46
|
+
else
|
47
|
+
return 'growl'
|
70
48
|
end
|
71
49
|
end
|
72
50
|
|
data/lib/pomo/notifier.rb
CHANGED
@@ -6,13 +6,13 @@ module Pomo
|
|
6
6
|
# Initialize notifier library from configuration.
|
7
7
|
def initialize(config)
|
8
8
|
if config.notifier == 'notification_center'
|
9
|
-
@notifier = Pomo::Notifier::
|
10
|
-
elsif config.notifier == 'libnotify'
|
11
|
-
@notifier = Pomo::Notifier::Growl.new
|
9
|
+
@notifier = Pomo::Notifier::NotificationCenterNotifier.new
|
12
10
|
elsif config.notifier == 'growl'
|
13
|
-
@notifier = Pomo::Notifier::
|
11
|
+
@notifier = Pomo::Notifier::GrowlNotifier.new
|
12
|
+
elsif config.notifier == 'libnotify'
|
13
|
+
@notifier = Pomo::Notifier::LibnotifyNotifier.new
|
14
14
|
elsif config.notifier == 'quicksilver'
|
15
|
-
@notifier = Pomo::Notifier::
|
15
|
+
@notifier = Pomo::Notifier::QuicksilverNotifier.new
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
data/lib/pomo/os.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Pomo
|
2
|
+
module OS
|
3
|
+
module_function
|
4
|
+
|
5
|
+
def linux?
|
6
|
+
(/linux/ =~ RbConfig::CONFIG['host_os']) !=nil
|
7
|
+
end
|
8
|
+
|
9
|
+
def mac?
|
10
|
+
(/mac|darwin/ =~ RbConfig::CONFIG['host_os']) != nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def windows?
|
14
|
+
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RbConfig::CONFIG['host_os']) != nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def has_notification_center?
|
18
|
+
return false unless OS.mac?
|
19
|
+
|
20
|
+
full_version = `/usr/bin/sw_vers -productVersion`.to_s.chomp
|
21
|
+
version = /(10\.\d+)(\.\d+)?/.match(full_version).captures.first.to_f
|
22
|
+
return (version >= 10.8)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
data/lib/pomo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pomo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-12-
|
13
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: commander
|
@@ -102,6 +102,7 @@ extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
104
|
- .gitignore
|
105
|
+
- CONTRIBUTING.md
|
105
106
|
- DEVELOPMENT
|
106
107
|
- Gemfile
|
107
108
|
- HISTORY.md
|
@@ -115,10 +116,11 @@ files:
|
|
115
116
|
- lib/pomo/github_task.rb
|
116
117
|
- lib/pomo/list.rb
|
117
118
|
- lib/pomo/notifier.rb
|
118
|
-
- lib/pomo/notifier/
|
119
|
-
- lib/pomo/notifier/
|
120
|
-
- lib/pomo/notifier/
|
121
|
-
- lib/pomo/notifier/
|
119
|
+
- lib/pomo/notifier/growl_notifier.rb
|
120
|
+
- lib/pomo/notifier/libnotify_notifier.rb
|
121
|
+
- lib/pomo/notifier/notification_center_notifier.rb
|
122
|
+
- lib/pomo/notifier/quicksilver_notifier.rb
|
123
|
+
- lib/pomo/os.rb
|
122
124
|
- lib/pomo/task.rb
|
123
125
|
- lib/pomo/version.rb
|
124
126
|
- pomo.gemspec
|
@@ -153,7 +155,7 @@ rubyforge_project: pomo
|
|
153
155
|
rubygems_version: 1.8.24
|
154
156
|
signing_key:
|
155
157
|
specification_version: 3
|
156
|
-
summary: pomo-2.0.
|
158
|
+
summary: pomo-2.0.2
|
157
159
|
test_files:
|
158
160
|
- spec/pomo_spec.rb
|
159
161
|
- spec/spec_helper.rb
|