thyme 0.0.9 → 0.0.10
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.
- data/README.md +2 -1
- data/{thyme → bin/thyme} +1 -1
- data/{thyme.rb → lib/thyme.rb} +2 -2
- metadata +5 -23
- data/thyme_test.rb +0 -47
data/README.md
CHANGED
@@ -34,7 +34,7 @@ Thyme is configurable and extensible. All configurations live in the
|
|
34
34
|
set :timer, 25*60
|
35
35
|
set :interval, 1
|
36
36
|
set :tmux, true
|
37
|
-
set :tmux_theme "#[fg=mycolor,bg=mycolor]#[fg=%s]%s#[fg=mycolor,bg=mycolor]"
|
37
|
+
set :tmux_theme, "#[fg=mycolor,bg=mycolor]#[fg=%s]%s#[fg=mycolor,bg=mycolor]"
|
38
38
|
|
39
39
|
option :b, :break, 'start a break' do
|
40
40
|
set :timer, 5*60
|
@@ -58,6 +58,7 @@ The `set` method sets different configurations. There are only two:
|
|
58
58
|
* `:timer` is the number of seconds to countdown from
|
59
59
|
* `:interval` is the refresh rate of the progress bar and tmux status in seconds
|
60
60
|
* `:tmux` is whether or not you want tmux integration on (off by default)
|
61
|
+
* `:tmux_theme` optionally lets you format the tmux status
|
61
62
|
|
62
63
|
The `option` method adds new options to the `thyme` command. In the above
|
63
64
|
example, we can now execute `thyme -b` or `thyme -t`. Use `thyme -h` to see
|
data/{thyme → bin/thyme}
RENAMED
data/{thyme.rb → lib/thyme.rb}
RENAMED
@@ -2,11 +2,11 @@ require 'ruby-progressbar'
|
|
2
2
|
require 'date'
|
3
3
|
|
4
4
|
class Thyme
|
5
|
-
VERSION = '0.0.
|
5
|
+
VERSION = '0.0.10'
|
6
6
|
CONFIG_FILE = "#{ENV['HOME']}/.thymerc"
|
7
7
|
PID_FILE = "#{ENV['HOME']}/.thyme-pid"
|
8
8
|
TMUX_FILE = "#{ENV['HOME']}/.thyme-tmux"
|
9
|
-
OPTIONS = [:timer, :tmux, :interval]
|
9
|
+
OPTIONS = [:timer, :tmux, :interval, :tmux_theme]
|
10
10
|
|
11
11
|
def initialize
|
12
12
|
@timer = 25 * 60
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thyme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Hugh Bien
|
9
9
|
autorequire:
|
10
|
-
bindir:
|
10
|
+
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby-progressbar
|
@@ -27,22 +27,6 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: minitest
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
30
|
description: Extensible and configurable timer for Pomodoro Technique.
|
47
31
|
email:
|
48
32
|
- hugh@hughbien.com
|
@@ -51,12 +35,10 @@ executables:
|
|
51
35
|
extensions: []
|
52
36
|
extra_rdoc_files: []
|
53
37
|
files:
|
54
|
-
- thyme.rb
|
55
|
-
- thyme_test.rb
|
56
38
|
- LICENSE.md
|
57
39
|
- README.md
|
58
|
-
- thyme
|
59
|
-
-
|
40
|
+
- bin/thyme
|
41
|
+
- lib/thyme.rb
|
60
42
|
homepage: http://thymerb.com
|
61
43
|
licenses: []
|
62
44
|
post_install_message:
|
data/thyme_test.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require "#{File.dirname(__FILE__)}/thyme"
|
3
|
-
require 'minitest'
|
4
|
-
|
5
|
-
Minitest.autorun
|
6
|
-
|
7
|
-
class ThymeTest < Minitest::Test
|
8
|
-
def setup
|
9
|
-
# TODO: stub out progress bar
|
10
|
-
@thyme = Thyme.new
|
11
|
-
@thyme.set(:interval, 0)
|
12
|
-
@thyme.set(:timer, 0)
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_format
|
16
|
-
assert_equal('25:00', @thyme.send(:format, 25*60, 2))
|
17
|
-
assert_equal('24:59', @thyme.send(:format, 25*60-1, 2))
|
18
|
-
assert_equal(' 5:00', @thyme.send(:format, 5*60, 2))
|
19
|
-
assert_equal(' 4:05', @thyme.send(:format, 4*60+5, 2))
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_color
|
23
|
-
assert_equal('default', @thyme.send(:color, 5*60))
|
24
|
-
assert_equal('red,bold', @thyme.send(:color, 5*60-1))
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_set
|
28
|
-
assert_equal(0, @thyme.instance_variable_get('@timer'))
|
29
|
-
@thyme.set(:timer, 20*60)
|
30
|
-
assert_equal(20*60, @thyme.instance_variable_get('@timer'))
|
31
|
-
assert_raises(ThymeError) { @thyme.set(:invalid, nil) }
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_run
|
35
|
-
@thyme.run
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_hooks
|
39
|
-
@thyme.before { @before_flag = true }
|
40
|
-
@thyme.after { @after_flag = true }
|
41
|
-
refute(@thyme.instance_variable_get('@before_flag'))
|
42
|
-
refute(@thyme.instance_variable_get('@after_flag'))
|
43
|
-
@thyme.run
|
44
|
-
assert(@thyme.instance_variable_get('@before_flag'))
|
45
|
-
assert(@thyme.instance_variable_get('@after_flag'))
|
46
|
-
end
|
47
|
-
end
|