tmuxodoro 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tmuxodoro.rb +1 -1
- data/lib/tmuxodoro/pomodoro.rb +8 -3
- data/lib/tmuxodoro/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e3a2d5b139d887365645589ec3071612a116a8e
|
4
|
+
data.tar.gz: 3ef177fe2b4d5cbfd2a94fa8de825275488cf289
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee6117d7ac981c065d3f3b444394104b258994ef11204f9ddd8bc00f9aeb1309c3bb9f62f590d881b6fdb472eed625160e96d69e351c6c1ea144aaadcfb88468
|
7
|
+
data.tar.gz: a10be0223de1095ce490357ded338e8144cd10a1a8c909763a233de3777dd0d4523f5be640ce9c6153b9cd894160c43d2bea5a437e8f5e14bc508d429511d886
|
data/lib/tmuxodoro.rb
CHANGED
data/lib/tmuxodoro/pomodoro.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
class Pomodoro
|
2
2
|
MINUTE = 60
|
3
3
|
|
4
|
-
attr_reader :tomatoes, :tomato_time, :rest_time, :stop_at
|
4
|
+
attr_reader :tomatoes, :tomato_time, :rest_time, :stop_at, :initial_tomatoes
|
5
5
|
|
6
6
|
def initialize(tomatoes: nil, tomato_time: nil, rest_time: nil)
|
7
|
-
@tomatoes = tomatoes || 8
|
7
|
+
@tomatoes = @initial_tomatoes = tomatoes || 8
|
8
8
|
@tomato_time = tomato_time || 25 * MINUTE
|
9
9
|
@rest_time = rest_time || 5 * MINUTE
|
10
10
|
end
|
@@ -17,11 +17,12 @@ class Pomodoro
|
|
17
17
|
"rest: #{remaining_rest_time} min\n"
|
18
18
|
end
|
19
19
|
else
|
20
|
-
|
20
|
+
remain_tomatoes_status
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
def start
|
25
|
+
@tomatoes = initial_tomatoes if tomatoes == 0
|
25
26
|
@tomatoes -= 1
|
26
27
|
@stop_at = Time.now + tomato_time
|
27
28
|
end
|
@@ -45,4 +46,8 @@ class Pomodoro
|
|
45
46
|
return unless stop_at
|
46
47
|
((stop_at + rest_time - Time.now) / MINUTE).ceil
|
47
48
|
end
|
49
|
+
|
50
|
+
def remain_tomatoes_status
|
51
|
+
tomatoes > 0 ? "🍅 #{tomatoes}\n" : "work is done\n"
|
52
|
+
end
|
48
53
|
end
|
data/lib/tmuxodoro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tmuxodoro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timur Yanberdin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|