thyme 0.0.1

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 (6) hide show
  1. data/LICENSE.md +23 -0
  2. data/README.md +100 -0
  3. data/thyme +12 -0
  4. data/thyme.rb +4 -0
  5. data/thyme_test.rb +12 -0
  6. metadata +68 -0
data/LICENSE.md ADDED
@@ -0,0 +1,23 @@
1
+ Copyright (c) Hugh Bien
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ Redistributions of source code must retain the above copyright notice, this list
8
+ of conditions and the following disclaimer.
9
+
10
+ Redistributions in binary form must reproduce the above copyright notice, this
11
+ list of conditions and the following disclaimer in the documentation and/or
12
+ other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
18
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,100 @@
1
+ Description
2
+ ===========
3
+
4
+ Thyme is a console pomodoro timer.
5
+
6
+ Installation
7
+ ============
8
+
9
+ $ gem install thyme
10
+
11
+ Usage
12
+ =====
13
+
14
+ Start thyme with:
15
+
16
+ $ thyme
17
+ [=.........................] 25m
18
+
19
+ You'll have 25 minutes by default. `Ctrl-C` to interrupt. You can also start
20
+ it in daemon mode, which is only useful if you've got tmux integration to notify
21
+ you of the timer:
22
+
23
+ $ thyme -d
24
+
25
+ To interrupt the timer in daemon mode, simply run `thyme --stop`. Or wait 25
26
+ minutes for it to kill itself.
27
+
28
+ Configure
29
+ =========
30
+
31
+ Thyme is configurable and extensible. All configurations live in the
32
+ `~/.thymerc` file:
33
+
34
+ set :timer, 25
35
+ set :outfile, "~/.thyme-tmux"
36
+
37
+ option :o, :open, 'opens today & records sheets' do
38
+ `vim -O ~/.thyme-today.md ~/.thyme-records.md`
39
+ end
40
+
41
+ before do
42
+ puts "Get ready, get set, GO!"
43
+ end
44
+
45
+ after do
46
+ `mplayer ~/music/wohoo.mp3`
47
+ `vim -O ~/.thyme-today.md`
48
+ end
49
+
50
+ The `set` method sets different configurations. There are only two:
51
+
52
+ * `:timer` is the number of minutes to countdown from
53
+ * `:outfile` is the file to write out progress to for tmux integration
54
+
55
+ The `option` method adds new options to the `thyme` command. In the above
56
+ example, we can now execute `thyme -o`. Use `thyme -h` to see available
57
+ options.
58
+
59
+ The `before` and `after` adds hooks to our timer. Now before the timer starts,
60
+ STDOUT will receive a message. After the timer ends, vim will open our today
61
+ sheet.
62
+
63
+ Integration
64
+ ===========
65
+
66
+ For tmux integration, make sure to set the outfile in `~/.thymerc`:
67
+
68
+ set :outfile, "~/.thyme-tmux"
69
+
70
+ Then in your `.tmux.conf` file:
71
+
72
+ set-option -g status-right '#(cat ~/.thyme-tmux)'
73
+
74
+ For vim integration, I like to execute `thyme -d` to toggle the timer. This only
75
+ works if you have tmux integration setup for the countdown:
76
+
77
+ nmap <leader>t :!thyme -d
78
+ nmap <leader>T :!thyme -s
79
+
80
+ TODO
81
+ ====
82
+
83
+ * add directory stucture (binary, lib file, tests, Rakefile, gemspec)
84
+ * add `--help`
85
+ * add 25 minute timer
86
+ * add progress bar
87
+ * add `--daemon` switch and `--stop`
88
+ * add config reader
89
+ * add config `set`
90
+ * add `set :timer`
91
+ * add `set :outfile`
92
+ * add config `option`
93
+ * add config `before` and `after`
94
+ * add color to outfile tmux integration (?)
95
+
96
+ License
97
+ =======
98
+
99
+ Copyright Hugh Bien - http://hughbien.com.
100
+ Released under BSD License, see LICENSE.md for more info.
data/thyme ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ require 'optparse'
3
+ require File.expand_path('thyme', File.dirname(__FILE__))
4
+
5
+ ARGV.options do |o|
6
+ o.set_summary_indent(' ')
7
+ o.banner = "Usage: #{File.basename($0)} [OPTION]"
8
+ o.define_head "Timer for Pomodoro Technique"
9
+ o.on('-h', '--help', 'show this help message') { puts o; exit }
10
+ o.parse!
11
+ puts o
12
+ end
data/thyme.rb ADDED
@@ -0,0 +1,4 @@
1
+ class Thyme
2
+ VERSION = '0.0.1'
3
+ CONFIG_FILE = "#{ENV['HOME']}/.thymerc"
4
+ end
data/thyme_test.rb ADDED
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+ require "#{File.dirname(__FILE__)}/thyme"
3
+ require 'minitest/autorun'
4
+
5
+ class ThymeTest < MiniTest::Unit::TestCase
6
+ def setup
7
+ end
8
+
9
+ def test_truth
10
+ assert(true)
11
+ end
12
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: thyme
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Hugh Bien
9
+ autorequire:
10
+ bindir: .
11
+ cert_chain: []
12
+ date: 2013-05-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: minitest
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Extensible and configurable timer for Pomodoro Technique.
31
+ email:
32
+ - hugh@hughbien.com
33
+ executables:
34
+ - thyme
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - thyme.rb
39
+ - thyme_test.rb
40
+ - LICENSE.md
41
+ - README.md
42
+ - thyme
43
+ - ./thyme
44
+ homepage: https://github.com/hughbien/thyme
45
+ licenses: []
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.3.6
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 1.8.23
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: Timer for Pomodoro Technique
68
+ test_files: []