doro 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +64 -0
  4. data/README.md +48 -0
  5. data/Rakefile +44 -0
  6. data/bin/doro +150 -0
  7. data/bin/logo.jpg +0 -0
  8. data/doc/DefaultTest.html +221 -0
  9. data/doc/Doro.html +109 -0
  10. data/doc/File.html +95 -0
  11. data/doc/FileUtils.html +95 -0
  12. data/doc/Gemfile.html +96 -0
  13. data/doc/Gemfile_lock.html +164 -0
  14. data/doc/Object.html +127 -0
  15. data/doc/README_rdoc.html +117 -0
  16. data/doc/Rakefile.html +140 -0
  17. data/doc/Test.html +95 -0
  18. data/doc/Test/Unit.html +95 -0
  19. data/doc/Test/Unit/TestCase.html +104 -0
  20. data/doc/created.rid +16 -0
  21. data/doc/css/fonts.css +167 -0
  22. data/doc/css/rdoc.css +590 -0
  23. data/doc/doro_gemspec.html +121 -0
  24. data/doc/doro_rdoc.html +100 -0
  25. data/doc/features/doro_feature.html +101 -0
  26. data/doc/fonts/Lato-Light.ttf +0 -0
  27. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  28. data/doc/fonts/Lato-Regular.ttf +0 -0
  29. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  30. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  31. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  32. data/doc/images/add.png +0 -0
  33. data/doc/images/arrow_up.png +0 -0
  34. data/doc/images/brick.png +0 -0
  35. data/doc/images/brick_link.png +0 -0
  36. data/doc/images/bug.png +0 -0
  37. data/doc/images/bullet_black.png +0 -0
  38. data/doc/images/bullet_toggle_minus.png +0 -0
  39. data/doc/images/bullet_toggle_plus.png +0 -0
  40. data/doc/images/date.png +0 -0
  41. data/doc/images/delete.png +0 -0
  42. data/doc/images/find.png +0 -0
  43. data/doc/images/loadingAnimation.gif +0 -0
  44. data/doc/images/macFFBgHack.png +0 -0
  45. data/doc/images/package.png +0 -0
  46. data/doc/images/page_green.png +0 -0
  47. data/doc/images/page_white_text.png +0 -0
  48. data/doc/images/page_white_width.png +0 -0
  49. data/doc/images/plugin.png +0 -0
  50. data/doc/images/ruby.png +0 -0
  51. data/doc/images/tag_blue.png +0 -0
  52. data/doc/images/tag_green.png +0 -0
  53. data/doc/images/transparent.png +0 -0
  54. data/doc/images/wrench.png +0 -0
  55. data/doc/images/wrench_orange.png +0 -0
  56. data/doc/images/zoom.png +0 -0
  57. data/doc/index.html +115 -0
  58. data/doc/js/darkfish.js +161 -0
  59. data/doc/js/jquery.js +4 -0
  60. data/doc/js/navigation.js +142 -0
  61. data/doc/js/search.js +109 -0
  62. data/doc/js/search_index.js +1 -0
  63. data/doc/js/searcher.js +228 -0
  64. data/doc/table_of_contents.html +114 -0
  65. data/doro.gemspec +26 -0
  66. data/doro.rdoc +5 -0
  67. data/features/doro.feature +16 -0
  68. data/features/step_definitions/doro_steps.rb +0 -0
  69. data/features/support/env.rb +15 -0
  70. data/lib/doro.rb +5 -0
  71. data/lib/doro/entries.rb +22 -0
  72. data/lib/doro/version.rb +3 -0
  73. data/results.html +473 -0
  74. data/test/default_test.rb +14 -0
  75. data/test/test_helper.rb +9 -0
  76. metadata +221 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d02765588dd4c833d4f9bc66fae716c149dba520
4
+ data.tar.gz: 049a0aabbe96cf5f94c546c4b10364b6b4857102
5
+ SHA512:
6
+ metadata.gz: 0f06fac5f5bd7d38d899591191e178b42974128611b0016ded2ee0b12c0d1a5e2cc6b77e863a504e2911444e34ef24ae2e9cc00cd5d93e7cc5031def0de99c29
7
+ data.tar.gz: dd850abc9e3efa1d99d6484fdf67babd3564ff4487a94dd151ef170015d9391c821cd720bda13dfa9e12c97030f327640753b7d02302b0c7a0a24688ecbf76ea
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,64 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ doro (0.0.1)
5
+ gli (= 2.13.4)
6
+ notifier
7
+ ruby-progressbar
8
+ terminal-notifier
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ aruba (0.13.0)
14
+ childprocess (~> 0.5.6)
15
+ contracts (~> 0.9)
16
+ cucumber (>= 1.3.19)
17
+ ffi (~> 1.9.10)
18
+ rspec-expectations (>= 2.99)
19
+ thor (~> 0.19)
20
+ builder (3.2.2)
21
+ childprocess (0.5.9)
22
+ ffi (~> 1.0, >= 1.0.11)
23
+ contracts (0.13.0)
24
+ cucumber (2.3.2)
25
+ builder (>= 2.1.2)
26
+ cucumber-core (~> 1.4.0)
27
+ cucumber-wire (~> 0.0.1)
28
+ diff-lcs (>= 1.1.3)
29
+ gherkin (~> 3.2.0)
30
+ multi_json (>= 1.7.5, < 2.0)
31
+ multi_test (>= 0.1.2)
32
+ cucumber-core (1.4.0)
33
+ gherkin (~> 3.2.0)
34
+ cucumber-wire (0.0.1)
35
+ diff-lcs (1.2.5)
36
+ ffi (1.9.10)
37
+ gherkin (3.2.0)
38
+ gli (2.13.4)
39
+ json (1.8.3)
40
+ multi_json (1.11.2)
41
+ multi_test (0.1.2)
42
+ notifier (0.5.1)
43
+ rake (10.5.0)
44
+ rdoc (4.2.2)
45
+ json (~> 1.4)
46
+ rspec-expectations (3.4.0)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.4.0)
49
+ rspec-support (3.4.1)
50
+ ruby-progressbar (1.7.5)
51
+ terminal-notifier (1.6.3)
52
+ thor (0.19.1)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ aruba
59
+ doro!
60
+ rake
61
+ rdoc
62
+
63
+ BUNDLED WITH
64
+ 1.11.2
@@ -0,0 +1,48 @@
1
+ # doro
2
+
3
+ ## Description
4
+
5
+ A minimalist pomodoro application.
6
+
7
+ ## Install
8
+
9
+ `$ gem install doro`
10
+
11
+ ## Usage
12
+
13
+ `$ doro start [-t tag] description of task`
14
+
15
+ This starts a 25 minute pomodoro timer in your terminal. To exit the pomodoro early, you can sent an interrupt with Ctrl+C. Whether you let it finish or not, it will save an entry of your pomodoro to `~/.doro` and notify you.
16
+
17
+ `$ doro list [-n num]`
18
+
19
+ This displays a list of your pomodoro entries. Defaults to showing your last 10 entries.
20
+
21
+ `$ doro break [-t num] [--long]`
22
+
23
+ This starts a 5 minute break timer to be used in between pomodoros.
24
+
25
+ `$ doro help`
26
+
27
+ For detailed information.
28
+
29
+ ## Todo
30
+
31
+ - [ ] number flag on list
32
+ - [ ] time flag on break
33
+ - [ ] long switch on break
34
+ - [ ] remove dependencies
35
+ - [ ] colorize
36
+
37
+ ### Notifications
38
+
39
+ Supported notification platforms via [notifier](https://github.com/fnando/notifier) gem:
40
+
41
+ - Growl (Mac OS X)
42
+ - terminal-notifier (Notification Center wrapper for Mac OS X)
43
+ - GNTP Protocol (Growl, with Vagrant support)
44
+ - Kdialog (Linux/KDE)
45
+ - Knotify (Linux/KDE)
46
+ - OSD Cat (Linux)
47
+ - Libnotify (Linux)
48
+ - Snarl (Windows)
@@ -0,0 +1,44 @@
1
+ require 'rake/clean'
2
+ require 'rubygems'
3
+ require 'rubygems/package_task'
4
+ require 'rdoc/task'
5
+ require 'cucumber'
6
+ require 'cucumber/rake/task'
7
+ Rake::RDocTask.new do |rd|
8
+ rd.main = "README.rdoc"
9
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
10
+ rd.title = 'Doro'
11
+ end
12
+
13
+ spec = eval(File.read('doro.gemspec'))
14
+
15
+ Gem::PackageTask.new(spec) do |pkg|
16
+ end
17
+ CUKE_RESULTS = 'results.html'
18
+ CLEAN << CUKE_RESULTS
19
+ desc 'Run features'
20
+ Cucumber::Rake::Task.new(:features) do |t|
21
+ opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
22
+ opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
23
+ t.cucumber_opts = opts
24
+ t.fork = false
25
+ end
26
+
27
+ desc 'Run features tagged as work-in-progress (@wip)'
28
+ Cucumber::Rake::Task.new('features:wip') do |t|
29
+ tag_opts = ' --tags ~@pending'
30
+ tag_opts = ' --tags @wip'
31
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
32
+ t.fork = false
33
+ end
34
+
35
+ task :cucumber => :features
36
+ task 'cucumber:wip' => 'features:wip'
37
+ task :wip => 'features:wip'
38
+ require 'rake/testtask'
39
+ Rake::TestTask.new do |t|
40
+ t.libs << "test"
41
+ t.test_files = FileList['test/*_test.rb']
42
+ end
43
+
44
+ task :default => [:test,:features]
@@ -0,0 +1,150 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ require 'fileutils'
4
+ require 'csv'
5
+ require 'date'
6
+ require 'ruby-progressbar'
7
+ require 'notifier'
8
+
9
+ require 'doro'
10
+
11
+ # Initialization
12
+ Process.setproctitle("doro")
13
+ include GLI::App
14
+ doro_file = "#{Dir.home}/.doro"
15
+ program_desc 'A minimalist pomodoro application'
16
+ version Doro::VERSION
17
+ subcommand_option_handling :normal
18
+ arguments :strict
19
+
20
+ # Begin CLI
21
+ desc 'Displays completed pomodoros'
22
+ arg_name '*no arguments*'
23
+ command :list do |c|
24
+
25
+ c.desc 'Number of pomodoros to show'
26
+ c.default_value 10
27
+ c.flag :n
28
+
29
+ c.action do |global_options,options,args|
30
+
31
+ Doro::Entries::display_entries(doro_file: doro_file, num_entries: options[:n])
32
+
33
+ end
34
+ end
35
+
36
+
37
+
38
+ desc 'Begins a pomodoro timer'
39
+ arg_name '*description of task* (eg. cool task)'
40
+ command :start do |c|
41
+
42
+ c.desc 'Tag task'
43
+ c.default_value 'untagged'
44
+ c.flag :t, type: String
45
+
46
+ c.action do |global_options,options,args|
47
+ raise "You didn't specify a task" if args.empty?
48
+ interrupt = false
49
+ task_name = args.join(' ')
50
+ start_time = Time.now
51
+ seconds = 0
52
+
53
+ puts ''
54
+ bar = ProgressBar.create(
55
+ :title => task_name,
56
+ :format => '%a [%B] %t',
57
+ :progress_mark => '=',
58
+ :remainder_mark => ' ',
59
+ :total => 1500
60
+ )
61
+
62
+ Signal.trap("INT") { interrupt = true }
63
+
64
+ 1500.times do
65
+ break if interrupt == true
66
+ bar.increment
67
+ seconds += 1
68
+ sleep 1
69
+ end
70
+
71
+ print("\r")
72
+
73
+ if interrupt == false
74
+ Notifier.notify(
75
+ :image => "logo.png",
76
+ :title => task_name,
77
+ :message => "Your timer is up! Take a break!"
78
+ )
79
+ end
80
+
81
+ Doro::Entries::add_entry(
82
+ doro_file: doro_file,
83
+ task_name: task_name,
84
+ minutes: seconds / 60,
85
+ start_time: start_time,
86
+ tag: options[:t]
87
+ )
88
+ end
89
+ end
90
+
91
+
92
+
93
+ desc 'Begins a break timer'
94
+ arg_name '*none*'
95
+ command :break do |c|
96
+
97
+ c.desc 'Long (15 min) break'
98
+ c.switch :long
99
+
100
+ c.desc 'Set time in minutes'
101
+ c.default_value 5
102
+ c.flag :t, type: Integer
103
+
104
+ c.action do |global_options,options,args|
105
+ interrupt = false
106
+
107
+ minutes = options[:t]
108
+ options[:long]? minutes = 15 : nil
109
+
110
+ bar = ProgressBar.create(
111
+ :title => 'Break',
112
+ :format => '%a %bᗧ%i %t',
113
+ :progress_mark => ' ',
114
+ :remainder_mark => '・',
115
+ :total => minutes * 60
116
+ )
117
+
118
+ Signal.trap("INT") { interrupt = true }
119
+
120
+ (minutes * 60).times do
121
+ break if interrupt == true
122
+ bar.increment
123
+ sleep 1
124
+ end
125
+
126
+ if interrupt == false
127
+ Notifier.notify(
128
+ :image => "logo.png",
129
+ :title => 'Break',
130
+ :message => "Break time's over! Back to work!"
131
+ )
132
+ end
133
+ end
134
+ end
135
+
136
+
137
+
138
+ pre do |global,command,options,args|
139
+ FileUtils::touch doro_file unless File.file? doro_file
140
+ true
141
+ end
142
+
143
+ post do |global,command,options,args|
144
+ end
145
+
146
+ on_error do |exception|
147
+ true
148
+ end
149
+
150
+ exit run(ARGV)
Binary file
@@ -0,0 +1,221 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class DefaultTest - RDoc Documentation</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ </script>
12
+
13
+ <script src="./js/jquery.js"></script>
14
+ <script src="./js/darkfish.js"></script>
15
+
16
+ <link href="./css/fonts.css" rel="stylesheet">
17
+ <link href="./css/rdoc.css" rel="stylesheet">
18
+
19
+
20
+
21
+ <body id="top" role="document" class="class">
22
+ <nav role="navigation">
23
+ <div id="project-navigation">
24
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
+ <h2>
26
+ <a href="./index.html" rel="home">Home</a>
27
+ </h2>
28
+
29
+ <div id="table-of-contents-navigation">
30
+ <a href="./table_of_contents.html#pages">Pages</a>
31
+ <a href="./table_of_contents.html#classes">Classes</a>
32
+ <a href="./table_of_contents.html#methods">Methods</a>
33
+ </div>
34
+ </div>
35
+
36
+ <div id="search-section" role="search" class="project-section initially-hidden">
37
+ <form action="#" method="get" accept-charset="utf-8">
38
+ <div id="search-field-wrapper">
39
+ <input id="search-field" role="combobox" aria-label="Search"
40
+ aria-autocomplete="list" aria-controls="search-results"
41
+ type="text" name="search" placeholder="Search" spellcheck="false"
42
+ title="Type to search, Up and Down to navigate, Enter to load">
43
+ </div>
44
+
45
+ <ul id="search-results" aria-label="Search Results"
46
+ aria-busy="false" aria-expanded="false"
47
+ aria-atomic="false" class="initially-hidden"></ul>
48
+ </form>
49
+ </div>
50
+
51
+ </div>
52
+
53
+
54
+
55
+ <div id="class-metadata">
56
+
57
+ <div id="parent-class-section" class="nav-section">
58
+ <h3>Parent</h3>
59
+
60
+
61
+ <p class="link"><a href="Test/Unit/TestCase.html">Test::Unit::TestCase</a>
62
+
63
+ </div>
64
+
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <div id="method-list-section" class="nav-section">
69
+ <h3>Methods</h3>
70
+
71
+ <ul class="link-list" role="directory">
72
+
73
+ <li ><a href="#method-i-setup">#setup</a>
74
+
75
+ <li ><a href="#method-i-teardown">#teardown</a>
76
+
77
+ <li ><a href="#method-i-test_the_truth">#test_the_truth</a>
78
+
79
+ </ul>
80
+ </div>
81
+
82
+ </div>
83
+ </nav>
84
+
85
+ <main role="main" aria-labelledby="class-DefaultTest">
86
+ <h1 id="class-DefaultTest" class="class">
87
+ class DefaultTest
88
+ </h1>
89
+
90
+ <section class="description">
91
+
92
+ </section>
93
+
94
+
95
+
96
+
97
+ <section id="5Buntitled-5D" class="documentation-section">
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
108
+ <header>
109
+ <h3>Public Instance Methods</h3>
110
+ </header>
111
+
112
+
113
+ <div id="method-i-setup" class="method-detail ">
114
+
115
+ <div class="method-heading">
116
+ <span class="method-name">setup</span><span
117
+ class="method-args">()</span>
118
+
119
+ <span class="method-click-advice">click to toggle source</span>
120
+
121
+ </div>
122
+
123
+
124
+ <div class="method-description">
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <div class="method-source-code" id="setup-source">
132
+ <pre><span class="ruby-comment"># File test/default_test.rb, line 5</span>
133
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">setup</span>
134
+ <span class="ruby-keyword">end</span></pre>
135
+ </div>
136
+
137
+ </div>
138
+
139
+
140
+
141
+
142
+ </div>
143
+
144
+
145
+ <div id="method-i-teardown" class="method-detail ">
146
+
147
+ <div class="method-heading">
148
+ <span class="method-name">teardown</span><span
149
+ class="method-args">()</span>
150
+
151
+ <span class="method-click-advice">click to toggle source</span>
152
+
153
+ </div>
154
+
155
+
156
+ <div class="method-description">
157
+
158
+
159
+
160
+
161
+
162
+
163
+ <div class="method-source-code" id="teardown-source">
164
+ <pre><span class="ruby-comment"># File test/default_test.rb, line 8</span>
165
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">teardown</span>
166
+ <span class="ruby-keyword">end</span></pre>
167
+ </div>
168
+
169
+ </div>
170
+
171
+
172
+
173
+
174
+ </div>
175
+
176
+
177
+ <div id="method-i-test_the_truth" class="method-detail ">
178
+
179
+ <div class="method-heading">
180
+ <span class="method-name">test_the_truth</span><span
181
+ class="method-args">()</span>
182
+
183
+ <span class="method-click-advice">click to toggle source</span>
184
+
185
+ </div>
186
+
187
+
188
+ <div class="method-description">
189
+
190
+
191
+
192
+
193
+
194
+
195
+ <div class="method-source-code" id="test_the_truth-source">
196
+ <pre><span class="ruby-comment"># File test/default_test.rb, line 11</span>
197
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">test_the_truth</span>
198
+ <span class="ruby-identifier">assert</span> <span class="ruby-keyword">true</span>
199
+ <span class="ruby-keyword">end</span></pre>
200
+ </div>
201
+
202
+ </div>
203
+
204
+
205
+
206
+
207
+ </div>
208
+
209
+
210
+ </section>
211
+
212
+ </section>
213
+ </main>
214
+
215
+
216
+ <footer id="validator-badges" role="contentinfo">
217
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
218
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.2.
219
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
220
+ </footer>
221
+