todo-curses 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CONTRIBUTING.md +34 -0
- data/Gemfile +0 -5
- data/Gemfile.lock +28 -9
- data/README.md +120 -0
- data/README.rdoc +10 -92
- data/Rakefile +65 -28
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/todo-curses +37 -40
- data/images/todo-curses-demo.gif +0 -0
- data/lib/TodoCurses.rb +16 -0
- data/lib/{todo-txt → TodoCurses}/list.rb +21 -20
- data/lib/{todo-txt → TodoCurses}/logger.rb +2 -2
- data/lib/{todo-txt → TodoCurses}/task.rb +20 -20
- data/lib/TodoCurses/version.rb +3 -0
- data/lib/TodoCurses/view.rb +261 -0
- data/todo-curses.gemspec +26 -19
- metadata +148 -34
- data/features/step_definitions/todo_steps.rb +0 -6
- data/features/support/env.rb +0 -15
- data/features/todo.feature +0 -8
- data/lib/todo-txt.rb +0 -7
- data/lib/todo.rb +0 -6
- data/lib/todo/todo_viewer.rb +0 -283
- data/lib/todo/version.rb +0 -3
- data/reset.sh +0 -2
- data/run.sh +0 -2
- data/test/default_test.rb +0 -14
- data/test/test_helper.rb +0 -9
- data/todo.rdoc +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 364b06f70215a62401102eb261da618bb3266e55
|
4
|
+
data.tar.gz: c714802c916233c242d6de543b9fa23d5bb968bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b253fd3d83971f390fa44d1d4587d63eda1496246a0a6bddc939533f393edfc1182f6cb6384db45b4538ef6cdb0f4a918b3697bae8b9d0033d4d9a6dde9a92
|
7
|
+
data.tar.gz: 1afe50ddf112f801d31ac13afdcff4f2bad559bf76d8a571f968fac4847e3eec1453c5d66765e611b4621c200687dec453f5da6d603c8aab4d07c5b5c1df7f36
|
data/.gitignore
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
If you find this app useful, please consider contributing to its
|
4
|
+
development. There are plenty of wish-list features in the
|
5
|
+
[bug tracker][bugtracker].
|
6
|
+
|
7
|
+
To get started, fork the repo, have a look around, and try building
|
8
|
+
the gem:
|
9
|
+
|
10
|
+
gem build todo-curses.gemspec
|
11
|
+
|
12
|
+
This should succeed.
|
13
|
+
|
14
|
+
Then, [find an issue][bugtracker] (or log one) and add a comment saying that
|
15
|
+
you'd like to work on it.
|
16
|
+
(So that we don't end up with duplicate effort.)
|
17
|
+
|
18
|
+
## Developing
|
19
|
+
|
20
|
+
To make life a little easier, I've set up some Rake tasks.
|
21
|
+
If you create a `todo.txt.bak` file, you can run `rake reset`, which
|
22
|
+
will copy it into `todo.txt`. Then you can run `rake` and it will
|
23
|
+
open the app on this file.
|
24
|
+
|
25
|
+
## Submitting
|
26
|
+
|
27
|
+
Once it looks good, write up a [good commit message][commit].
|
28
|
+
Push to your fork and submit a pull request. Be sure to mention
|
29
|
+
the issue number you were working on in the bug tracker so that
|
30
|
+
they're linked up.
|
31
|
+
|
32
|
+
[bugtracker]: https://github.com/lorentrogers/jekylljournal/issues
|
33
|
+
[commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
34
|
+
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
todo-curses (0.0.
|
5
|
-
|
4
|
+
todo-curses (0.0.4)
|
5
|
+
methadone (~> 1.9, >= 1.9.2)
|
6
|
+
ncursesw (~> 1.4, >= 1.4.9)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
@@ -14,6 +15,7 @@ GEM
|
|
14
15
|
ffi (~> 1.9.10)
|
15
16
|
rspec-expectations (>= 2.99)
|
16
17
|
thor (~> 0.19)
|
18
|
+
ast (2.2.0)
|
17
19
|
builder (3.2.2)
|
18
20
|
childprocess (0.5.9)
|
19
21
|
ffi (~> 1.0, >= 1.0.11)
|
@@ -32,29 +34,46 @@ GEM
|
|
32
34
|
diff-lcs (1.2.5)
|
33
35
|
ffi (1.9.10)
|
34
36
|
gherkin (3.2.0)
|
35
|
-
gli (2.13.4)
|
36
37
|
json (1.8.3)
|
38
|
+
methadone (1.9.2)
|
39
|
+
bundler
|
37
40
|
multi_json (1.11.2)
|
38
41
|
multi_test (0.1.2)
|
39
42
|
ncursesw (1.4.9)
|
40
|
-
|
43
|
+
parser (2.3.0.7)
|
44
|
+
ast (~> 2.2)
|
45
|
+
power_assert (0.2.7)
|
46
|
+
powerpack (0.1.1)
|
47
|
+
rainbow (2.1.0)
|
48
|
+
rake (10.5.0)
|
41
49
|
rdoc (4.2.2)
|
42
50
|
json (~> 1.4)
|
43
51
|
rspec-expectations (3.4.0)
|
44
52
|
diff-lcs (>= 1.2.0, < 2.0)
|
45
53
|
rspec-support (~> 3.4.0)
|
46
54
|
rspec-support (3.4.1)
|
55
|
+
rubocop (0.39.0)
|
56
|
+
parser (>= 2.3.0.7, < 3.0)
|
57
|
+
powerpack (~> 0.1)
|
58
|
+
rainbow (>= 1.99.1, < 3.0)
|
59
|
+
ruby-progressbar (~> 1.7)
|
60
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
61
|
+
ruby-progressbar (1.7.5)
|
62
|
+
test-unit (3.1.8)
|
63
|
+
power_assert
|
47
64
|
thor (0.19.1)
|
65
|
+
unicode-display_width (1.0.2)
|
48
66
|
|
49
67
|
PLATFORMS
|
50
68
|
ruby
|
51
69
|
|
52
70
|
DEPENDENCIES
|
53
|
-
aruba
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
71
|
+
aruba (~> 0.14.1)
|
72
|
+
bundler (~> 1.11)
|
73
|
+
rake (~> 10.0)
|
74
|
+
rdoc (~> 4.2, >= 4.2.2)
|
75
|
+
rubocop (~> 0.39.0)
|
76
|
+
test-unit (~> 3.1, >= 3.1.8)
|
58
77
|
todo-curses!
|
59
78
|
|
60
79
|
BUNDLED WITH
|
data/README.md
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
# TodoCurses
|
2
|
+
|
3
|
+
A curses-based application for managing todo.txt files.
|
4
|
+
|
5
|
+
![Todo-Curses demo screen capture](
|
6
|
+
https://raw.githubusercontent.com/lorentrogers/todo-curses/master/images/todo-curses-demo.gif)
|
7
|
+
|
8
|
+
A lot of the features are based on how
|
9
|
+
[todotxt.net](todotxt.net)
|
10
|
+
handles things. I really liked the overall design of the application,
|
11
|
+
just not the fact that it didn't run in my linux terminal. To solve
|
12
|
+
this, I decided to roll my own using Ruby and Ncurses. There was already
|
13
|
+
a robust library for handling todo.txt files, and Ncurses was something
|
14
|
+
I'd been meaning to learn for a while.
|
15
|
+
|
16
|
+
No doubt there's a ton of nasty code in here. I'm sure there's a lot
|
17
|
+
that can be refactored; pull requests welcome!
|
18
|
+
|
19
|
+
![Gem Version](https://badge.fury.io/rb/todo-curses.svg)
|
20
|
+
|
21
|
+
[Gem available on Rubygems.org](https://rubygems.org/gems/todo-curses)
|
22
|
+
|
23
|
+
[Source on github.com](https://github.com/lorentrogers/todo-curses)
|
24
|
+
|
25
|
+
## Installation
|
26
|
+
|
27
|
+
Grab the gem:
|
28
|
+
|
29
|
+
gem install todo-curses
|
30
|
+
|
31
|
+
Then you'll probably want to make an alias in your .\*rc file. Here's
|
32
|
+
mine:
|
33
|
+
|
34
|
+
alias tt#"todo-curses list \~/dev/todo/todo.txt"
|
35
|
+
|
36
|
+
## Current features
|
37
|
+
|
38
|
+
- Open todo.txt files and view a scrollable list of items
|
39
|
+
- Move to the next item with `j`
|
40
|
+
- Move to the prev item with `k`
|
41
|
+
- Create new items with `n`
|
42
|
+
- Toggle done / not done state with `x`
|
43
|
+
- Move priority down with `shift+j`
|
44
|
+
- Move priority up with `shift+k`
|
45
|
+
- Completed tasks are archived to done.txt on exit
|
46
|
+
|
47
|
+
## Planned features
|
48
|
+
|
49
|
+
- Safer file handling (confirmations, errors, etc.)
|
50
|
+
- Use ctrl instead of shift for priority change
|
51
|
+
- Color code priorities
|
52
|
+
- Add a spacer between priority groups
|
53
|
+
- Priority view with `ctrl+1`
|
54
|
+
- Project view with `ctrl+2`
|
55
|
+
- Strip out application wrapper; not needed
|
56
|
+
- Prep for release as a gem
|
57
|
+
- If no argument is given, open the default file. Default tbd.
|
58
|
+
|
59
|
+
## Ideas for later
|
60
|
+
|
61
|
+
- Shift+J: Cycle through displays (Priority, project, etc.)
|
62
|
+
- F: filter tasks (free-text, one filter condition per line)
|
63
|
+
- T: append text to selected tasks
|
64
|
+
- O or Ctrl+O: open todo.txt file
|
65
|
+
- C or Ctrl+N: new todo.txt file
|
66
|
+
|
67
|
+
## Things not included
|
68
|
+
|
69
|
+
- A: archive tasks
|
70
|
+
- Ctrl+C: copy task to clipboard
|
71
|
+
- Ctrl+Shift+C: copy task to edit field
|
72
|
+
- Win+Alt+T: hide/unhide windows
|
73
|
+
- 0: clear filter
|
74
|
+
- 1-9: apply numbered filter preset
|
75
|
+
|
76
|
+
## Keyboard shortcut ideas
|
77
|
+
|
78
|
+
- N: new task
|
79
|
+
- J: next task
|
80
|
+
- K: prev task
|
81
|
+
- X: toggle task completion
|
82
|
+
- D or Del or Backspace: delete task (with confirmation)
|
83
|
+
- E or F2: update task
|
84
|
+
- I: set priority
|
85
|
+
- . or F5: reload tasks from file
|
86
|
+
- ?: show help
|
87
|
+
- Shift+K: increase priority
|
88
|
+
- Shift+J: decrease priority
|
89
|
+
- Alt+Left/Right: clear priority
|
90
|
+
- Ctrl+Alt+Up: increase due date by 1 day
|
91
|
+
- Ctrl+Alt+Down: decrease due date by 1 day
|
92
|
+
- Ctrl+Alt+Left/Right: remove due date
|
93
|
+
|
94
|
+
## Development
|
95
|
+
|
96
|
+
To release a new version, update
|
97
|
+
the version number in `version.rb`, and then run
|
98
|
+
`bundle exec rake release`, which will create a git tag for the version,
|
99
|
+
push git commits and tags, and push the `.gem`
|
100
|
+
file to [rubygems.org](https://rubygems.org).
|
101
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
102
|
+
You can also run `bin/console` for an interactive prompt that
|
103
|
+
will allow you to experiment.
|
104
|
+
|
105
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
106
|
+
|
107
|
+
## License
|
108
|
+
|
109
|
+
This program is free software: you can redistribute it and/or modify
|
110
|
+
it under the terms of the GNU General Public License as published by
|
111
|
+
the Free Software Foundation, either version 3 of the License, or
|
112
|
+
(at your option) any later version.
|
113
|
+
|
114
|
+
This program is distributed in the hope that it will be useful,
|
115
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
116
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
117
|
+
GNU General Public License for more details.
|
118
|
+
|
119
|
+
You should have received a copy of the GNU General Public License
|
120
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
data/README.rdoc
CHANGED
@@ -1,101 +1,19 @@
|
|
1
|
-
=
|
1
|
+
= todo-curses - DESCRIBE YOUR GEM
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
{todotxt.net}[todotxt.net] handles things. I really liked the overall
|
6
|
-
design of the application, just not the fact that it didn't run in my
|
7
|
-
linux terminal. To solve this, I decided to roll my own using Ruby and
|
8
|
-
Ncurses. There was already a pretty robust library for handling todo.txt
|
9
|
-
files, and Ncurses was something I'd been meaning to learn for a while.
|
3
|
+
Author:: YOUR NAME (YOUR EMAIL)
|
4
|
+
Copyright:: Copyright (c) 2016 YOUR NAME
|
10
5
|
|
11
|
-
No doubt there's a ton of nasty code in here. Please help me along if you're
|
12
|
-
interested. I'm sure there's a lot that can be refactored.
|
13
6
|
|
14
|
-
|
7
|
+
DESCRIBE YOUR GEM HERE
|
15
8
|
|
16
|
-
|
9
|
+
== Links
|
17
10
|
|
18
|
-
{Source on
|
11
|
+
* {Source on Github}[LINK TO GITHUB]
|
12
|
+
* RDoc[LINK TO RDOC.INFO]
|
19
13
|
|
20
|
-
==
|
14
|
+
== Install
|
21
15
|
|
22
|
-
|
16
|
+
== Examples
|
23
17
|
|
24
|
-
|
18
|
+
== Contributing
|
25
19
|
|
26
|
-
Then you'll probably want to make an alias in your .*rc file. Here's mine:
|
27
|
-
|
28
|
-
alias tt="todo-curses list ~/dev/todo/todo.txt"
|
29
|
-
|
30
|
-
== Current features
|
31
|
-
|
32
|
-
- Open todo.txt files and view a scrollable list of items
|
33
|
-
- Move to the next item with `j`
|
34
|
-
- Move to the prev item with `k`
|
35
|
-
- Create new items with `n`
|
36
|
-
- Toggle done / not done state with `x`
|
37
|
-
- Move priority down with `shift+j`
|
38
|
-
- Move priority up with `shift+k`
|
39
|
-
- Completed tasks are archived to done.txt on exit
|
40
|
-
|
41
|
-
== Planned features
|
42
|
-
|
43
|
-
- Safer file handling (confirmations, errors, etc.)
|
44
|
-
- Use ctrl instead of shift for priority change
|
45
|
-
- Color code priorities
|
46
|
-
- Add a spacer between priority groups
|
47
|
-
- Priority view with `ctrl+1`
|
48
|
-
- Project view with `ctrl+2`
|
49
|
-
- Strip out application wrapper; not needed
|
50
|
-
- Prep for release as a gem
|
51
|
-
- If no argument is given, open the default file. Default tbd.
|
52
|
-
|
53
|
-
== Ideas for later
|
54
|
-
|
55
|
-
Shift+J: Cycle through displays (Priority, project, etc.)
|
56
|
-
F: filter tasks (free-text, one filter condition per line)
|
57
|
-
T: append text to selected tasks
|
58
|
-
O or Ctrl+O: open todo.txt file
|
59
|
-
C or Ctrl+N: new todo.txt file
|
60
|
-
|
61
|
-
== Things not included
|
62
|
-
|
63
|
-
A: archive tasks
|
64
|
-
Ctrl+C: copy task to clipboard
|
65
|
-
Ctrl+Shift+C: copy task to edit field
|
66
|
-
Win+Alt+T: hide/unhide windows
|
67
|
-
0: clear filter
|
68
|
-
1-9: apply numbered filter preset
|
69
|
-
|
70
|
-
== Keyboard shortcut ideas
|
71
|
-
|
72
|
-
N: new task
|
73
|
-
J: next task
|
74
|
-
K: prev task
|
75
|
-
X: toggle task completion
|
76
|
-
D or Del or Backspace: delete task (with confirmation)
|
77
|
-
E or F2: update task
|
78
|
-
I: set priority
|
79
|
-
. or F5: reload tasks from file
|
80
|
-
?: show help
|
81
|
-
Shift+K: increase priority
|
82
|
-
Shift+J: decrease priority
|
83
|
-
Alt+Left/Right: clear priority
|
84
|
-
Ctrl+Alt+Up: increase due date by 1 day
|
85
|
-
Ctrl+Alt+Down: decrease due date by 1 day
|
86
|
-
Ctrl+Alt+Left/Right: remove due date
|
87
|
-
|
88
|
-
== License
|
89
|
-
|
90
|
-
This program is free software: you can redistribute it and/or modify
|
91
|
-
it under the terms of the GNU General Public License as published by
|
92
|
-
the Free Software Foundation, either version 3 of the License, or
|
93
|
-
(at your option) any later version.
|
94
|
-
|
95
|
-
This program is distributed in the hope that it will be useful,
|
96
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
97
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
98
|
-
GNU General Public License for more details.
|
99
|
-
|
100
|
-
You should have received a copy of the GNU General Public License
|
101
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
data/Rakefile
CHANGED
@@ -1,44 +1,81 @@
|
|
1
|
+
def dump_load_path
|
2
|
+
puts $LOAD_PATH.join("\n")
|
3
|
+
found = nil
|
4
|
+
$LOAD_PATH.each do |path|
|
5
|
+
if File.exists?(File.join(path,"rspec"))
|
6
|
+
puts "Found rspec in #{path}"
|
7
|
+
if File.exists?(File.join(path,"rspec","core"))
|
8
|
+
puts "Found core"
|
9
|
+
if File.exists?(File.join(path,"rspec","core","rake_task"))
|
10
|
+
puts "Found rake_task"
|
11
|
+
found = path
|
12
|
+
else
|
13
|
+
puts "!! no rake_task"
|
14
|
+
end
|
15
|
+
else
|
16
|
+
puts "!!! no core"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
if found.nil?
|
21
|
+
puts "Didn't find rspec/core/rake_task anywhere"
|
22
|
+
else
|
23
|
+
puts "Found in #{path}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
require 'bundler'
|
1
27
|
require 'rake/clean'
|
2
|
-
|
3
|
-
require '
|
4
|
-
require '
|
28
|
+
|
29
|
+
require 'rake/testtask'
|
30
|
+
require 'rubocop/rake_task'
|
31
|
+
|
5
32
|
require 'cucumber'
|
6
33
|
require 'cucumber/rake/task'
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
34
|
+
gem 'rdoc' # we need the installed RDoc gem, not the system one
|
35
|
+
require 'rdoc/task'
|
36
|
+
|
37
|
+
include Rake::DSL
|
38
|
+
|
39
|
+
Bundler::GemHelper.install_tasks
|
12
40
|
|
13
|
-
spec = eval(File.read('todo.gemspec'))
|
14
41
|
|
15
|
-
|
42
|
+
Rake::TestTask.new do |t|
|
43
|
+
t.pattern = 'test/tc_*.rb'
|
16
44
|
end
|
45
|
+
|
46
|
+
|
17
47
|
CUKE_RESULTS = 'results.html'
|
18
48
|
CLEAN << CUKE_RESULTS
|
19
|
-
desc 'Run features'
|
20
49
|
Cucumber::Rake::Task.new(:features) do |t|
|
21
|
-
|
22
|
-
opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
|
23
|
-
t.cucumber_opts = opts
|
50
|
+
t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty --no-source -x"
|
24
51
|
t.fork = false
|
25
52
|
end
|
26
53
|
|
27
|
-
|
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
|
54
|
+
Rake::RDocTask.new do |rd|
|
34
55
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
require 'rake/testtask'
|
39
|
-
Rake::TestTask.new do |t|
|
40
|
-
t.libs << "test"
|
41
|
-
t.test_files = FileList['test/*_test.rb']
|
56
|
+
rd.main = "README.rdoc"
|
57
|
+
|
58
|
+
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
|
42
59
|
end
|
43
60
|
|
44
61
|
task :default => [:test,:features]
|
62
|
+
|
63
|
+
# Run the test application
|
64
|
+
desc 'run'
|
65
|
+
task :run do
|
66
|
+
sh 'bundle exec bin/todo-curses list todo.txt'
|
67
|
+
end
|
68
|
+
|
69
|
+
# Reset the testing todo.txt file, if you have one.
|
70
|
+
desc 'reset'
|
71
|
+
task :reset do
|
72
|
+
sh 'cp todo.txt.bak todo.txt'
|
73
|
+
end
|
74
|
+
|
75
|
+
# Easy way to rubocop the project
|
76
|
+
desc 'Lint Ruby'
|
77
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
78
|
+
t.patterns = ['bin/**/*.rb', 'lib/**/*.rb']
|
79
|
+
end
|
80
|
+
|
81
|
+
task default: :run
|