tomate 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/README.md +5 -1
- data/Rakefile +5 -0
- data/bin/tomate +1 -0
- data/lib/tomate.rb +0 -5
- data/lib/tomate/timer.rb +11 -5
- data/lib/tomate/version.rb +1 -1
- data/spec/spec_helper.rb +6 -0
- data/spec/timer_spec.rb +34 -0
- data/tomate.gemspec +20 -4
- metadata +62 -16
- data/.gitignore +0 -17
- data/lib/tomate/images/pomodoro.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b75b364b0e4c202aa62a5345076eb4e32a33f85
|
4
|
+
data.tar.gz: a03b87cbaaa9a5a748b90d5c2dfb747f479f5b46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d4ebac214f5be7013d08e108ad53e862e16d48bcddc11d57f6e01bfc3e17eb019fc4ce8b6b6c8107eb21b72caca2264b647e56ec55902f3898a2b55188b8713
|
7
|
+
data.tar.gz: e4a3f979864410661dc625d5e948dd60bfe8e9a18917655a77fbae3d43f35317ad42ac3b1a800c16c692e62fdb829e68e17b2878649aac425dc9bf80a23c5f26
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/README.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
# Tomate [![Gem Version](https://badge.fury.io/rb/tomate.png)](http://badge.fury.io/rb/tomate) [![Dependency Status](https://gemnasium.com/tbuehlmann/tomate.png)](https://gemnasium.com/tbuehlmann/tomate)
|
1
|
+
# Tomate [![Gem Version](https://badge.fury.io/rb/tomate.png)](http://badge.fury.io/rb/tomate) [![Build Status](https://travis-ci.org/tbuehlmann/tomate.svg)](https://travis-ci.org/tbuehlmann/tomate) [![Dependency Status](https://gemnasium.com/tbuehlmann/tomate.png)](https://gemnasium.com/tbuehlmann/tomate)
|
2
2
|
A Ruby based Pomodoro timer.
|
3
3
|
|
4
|
+
![Pomodoro Start](/images/pomodoro_start.png?raw=true "Pomodoro Start")
|
5
|
+
![Pomodoro Finish](/images/pomodoro_finish.png?raw=true "Pomodoro Finish")
|
6
|
+
|
4
7
|
## Requirements
|
5
8
|
- Ruby ≥ 1.9.2
|
9
|
+
- Ability to fork (*nix)
|
6
10
|
- libnotify-bin
|
7
11
|
|
8
12
|
## Installation
|
data/Rakefile
ADDED
data/bin/tomate
CHANGED
data/lib/tomate.rb
CHANGED
data/lib/tomate/timer.rb
CHANGED
@@ -2,18 +2,24 @@ module Tomate
|
|
2
2
|
class Timer
|
3
3
|
DEFAULT_DELAY = 25*60
|
4
4
|
|
5
|
-
def initialize(delay)
|
5
|
+
def initialize(delay = nil)
|
6
6
|
@delay = Integer(delay || DEFAULT_DELAY)
|
7
7
|
end
|
8
8
|
|
9
9
|
def start
|
10
|
-
|
11
|
-
|
10
|
+
fork_only!
|
11
|
+
|
12
|
+
fork do
|
13
|
+
system('notify-send', '-i', 'Pomodoro', "Timer started: #{@delay} seconds.")
|
12
14
|
sleep @delay
|
13
|
-
|
15
|
+
system('notify-send', '-u', 'critical', '-t', '60000', '-i', 'Pomodoro', 'Take a break, nerd!')
|
14
16
|
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
15
20
|
|
16
|
-
|
21
|
+
def fork_only!
|
22
|
+
fail 'Your operating system does not support forking.' unless Process.respond_to?(:fork)
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|
data/lib/tomate/version.rb
CHANGED
data/spec/spec_helper.rb
ADDED
data/spec/timer_spec.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Tomate::Timer do
|
4
|
+
describe '#initialize' do
|
5
|
+
it 'raises for an invalid delay' do
|
6
|
+
expect { described_class.new('foo') }.to raise_error(ArgumentError)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#start' do
|
11
|
+
context 'with fork not available' do
|
12
|
+
before(:each) do
|
13
|
+
allow(Process).to receive(:respond_to?).with(:fork) { false }
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'fails' do
|
17
|
+
expect { subject.start }.to raise_error(RuntimeError)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'with fork available' do
|
22
|
+
before(:each) do
|
23
|
+
allow(subject).to receive(:fork).and_yield
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'sends notify-send notifications' do
|
27
|
+
expect(subject).to receive(:system).twice
|
28
|
+
expect(subject).to receive(:sleep).with(Tomate::Timer::DEFAULT_DELAY)
|
29
|
+
|
30
|
+
subject.start
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/tomate.gemspec
CHANGED
@@ -13,12 +13,28 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = 'https://github.com/tbuehlmann/tomate'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.
|
16
|
+
spec.require_paths = ['lib']
|
17
|
+
spec.files = %w(
|
18
|
+
.rspec
|
19
|
+
Gemfile
|
20
|
+
LICENSE
|
21
|
+
Rakefile
|
22
|
+
README.md
|
23
|
+
bin/tomate
|
24
|
+
lib/tomate.rb
|
25
|
+
lib/tomate/timer.rb
|
26
|
+
lib/tomate/version.rb
|
27
|
+
spec/spec_helper.rb
|
28
|
+
spec/timer_spec.rb
|
29
|
+
tomate.gemspec
|
30
|
+
)
|
17
31
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
32
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ['lib']
|
20
33
|
|
21
34
|
spec.required_ruby_version = '>= 1.9.2'
|
22
|
-
spec.add_dependency('slop', '~> 3.
|
23
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
35
|
+
spec.add_dependency('slop', '~> 3.5')
|
36
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
37
|
+
spec.add_development_dependency 'rake', '~> 10.3'
|
38
|
+
spec.add_development_dependency 'rspec', '~> 2.14'
|
39
|
+
spec.add_development_dependency 'pry', '0.9.12.6'
|
24
40
|
end
|
metadata
CHANGED
@@ -1,43 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Bühlmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.6'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.14'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.14'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.9.12.6
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.9.12.6
|
41
83
|
description: Starts a Pomodoro timer and notifies via notify-send.
|
42
84
|
email:
|
43
85
|
- tobias.buehlmann@gmx.de
|
@@ -46,15 +88,17 @@ executables:
|
|
46
88
|
extensions: []
|
47
89
|
extra_rdoc_files: []
|
48
90
|
files:
|
49
|
-
- .
|
91
|
+
- ".rspec"
|
50
92
|
- Gemfile
|
51
93
|
- LICENSE
|
52
94
|
- README.md
|
95
|
+
- Rakefile
|
53
96
|
- bin/tomate
|
54
97
|
- lib/tomate.rb
|
55
|
-
- lib/tomate/images/pomodoro.png
|
56
98
|
- lib/tomate/timer.rb
|
57
99
|
- lib/tomate/version.rb
|
100
|
+
- spec/spec_helper.rb
|
101
|
+
- spec/timer_spec.rb
|
58
102
|
- tomate.gemspec
|
59
103
|
homepage: https://github.com/tbuehlmann/tomate
|
60
104
|
licenses:
|
@@ -66,18 +110,20 @@ require_paths:
|
|
66
110
|
- lib
|
67
111
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
112
|
requirements:
|
69
|
-
- -
|
113
|
+
- - ">="
|
70
114
|
- !ruby/object:Gem::Version
|
71
115
|
version: 1.9.2
|
72
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
117
|
requirements:
|
74
|
-
- -
|
118
|
+
- - ">="
|
75
119
|
- !ruby/object:Gem::Version
|
76
120
|
version: '0'
|
77
121
|
requirements: []
|
78
122
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.2.2
|
80
124
|
signing_key:
|
81
125
|
specification_version: 4
|
82
126
|
summary: Ruby based Pomodoro timer.
|
83
|
-
test_files:
|
127
|
+
test_files:
|
128
|
+
- spec/spec_helper.rb
|
129
|
+
- spec/timer_spec.rb
|
data/.gitignore
DELETED
Binary file
|