todotxt 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -0
- data/Rakefile +7 -0
- data/lib/todotxt/cli.rb +1 -1
- data/lib/todotxt/version.rb +1 -1
- data/{fixtures → spec/fixtures}/complex_todo.txt +0 -0
- data/{fixtures → spec/fixtures}/simple_todo.txt +0 -0
- data/spec/todo_spec.rb +15 -15
- data/spec/todolist_spec.rb +14 -14
- data/todotxt.gemspec +5 -4
- metadata +40 -21
data/README.md
CHANGED
@@ -59,6 +59,13 @@ todo.txt.
|
|
59
59
|
Calling simply `todotxt` will automatically run the `ls` command.
|
60
60
|
|
61
61
|
|
62
|
+
## Screenshot
|
63
|
+
|
64
|
+
[Here](http://static.jsahlen.se/misc/todotxt_screenshot.png)
|
65
|
+
|
66
|
+
*Screenshot of Todotxt in a Terminal window using [Solarized](http://ethanschoonover.com/solarized) colors.*
|
67
|
+
|
68
|
+
|
62
69
|
## Dependencies
|
63
70
|
|
64
71
|
* [Thor](http://github.com/wycats/thor)
|
data/Rakefile
CHANGED
data/lib/todotxt/cli.rb
CHANGED
data/lib/todotxt/version.rb
CHANGED
File without changes
|
File without changes
|
data/spec/todo_spec.rb
CHANGED
@@ -2,12 +2,12 @@ require "todotxt/todo"
|
|
2
2
|
|
3
3
|
describe Todotxt::Todo do
|
4
4
|
|
5
|
-
it "
|
5
|
+
it "creates a todo item string" do
|
6
6
|
todo = Todotxt::Todo.new "an item"
|
7
7
|
todo.to_s.should eql("an item")
|
8
8
|
end
|
9
9
|
|
10
|
-
it "
|
10
|
+
it "parses metadata when creating a simple item" do
|
11
11
|
todo = Todotxt::Todo.new "x an item +project1 +project2 @context1 @context2"
|
12
12
|
|
13
13
|
todo.to_s.should eql "x an item +project1 +project2 @context1 @context2"
|
@@ -17,7 +17,7 @@ describe Todotxt::Todo do
|
|
17
17
|
todo.done.should eql true
|
18
18
|
end
|
19
19
|
|
20
|
-
it "
|
20
|
+
it "parses metadata when creating an item with priority" do
|
21
21
|
todo = Todotxt::Todo.new "(A) x an item +project1 +project2 @context1 @context2"
|
22
22
|
|
23
23
|
todo.to_s.should eql "(A) x an item +project1 +project2 @context1 @context2"
|
@@ -27,13 +27,13 @@ describe Todotxt::Todo do
|
|
27
27
|
todo.done.should eql true
|
28
28
|
end
|
29
29
|
|
30
|
-
it "
|
30
|
+
it "stores line number when creating an item" do
|
31
31
|
todo = Todotxt::Todo.new "an item", "2"
|
32
32
|
|
33
33
|
todo.line.should eql "2"
|
34
34
|
end
|
35
35
|
|
36
|
-
it "
|
36
|
+
it "sets an item as done" do
|
37
37
|
todo = Todotxt::Todo.new "an item"
|
38
38
|
|
39
39
|
todo.do
|
@@ -42,7 +42,7 @@ describe Todotxt::Todo do
|
|
42
42
|
todo.done.should eql true
|
43
43
|
end
|
44
44
|
|
45
|
-
it "
|
45
|
+
it "sets an item as not done" do
|
46
46
|
todo = Todotxt::Todo.new "x an item"
|
47
47
|
|
48
48
|
todo.undo
|
@@ -51,7 +51,7 @@ describe Todotxt::Todo do
|
|
51
51
|
todo.done.should eql false
|
52
52
|
end
|
53
53
|
|
54
|
-
it "
|
54
|
+
it "adds priority to an item" do
|
55
55
|
todo = Todotxt::Todo.new "an item"
|
56
56
|
|
57
57
|
todo.prioritize "a"
|
@@ -60,7 +60,7 @@ describe Todotxt::Todo do
|
|
60
60
|
todo.priority.should eql "A"
|
61
61
|
end
|
62
62
|
|
63
|
-
it "
|
63
|
+
it "changes priority of an item" do
|
64
64
|
todo = Todotxt::Todo.new "(A) an item"
|
65
65
|
|
66
66
|
todo.prioritize "z"
|
@@ -69,7 +69,7 @@ describe Todotxt::Todo do
|
|
69
69
|
todo.priority.should eql "Z"
|
70
70
|
end
|
71
71
|
|
72
|
-
it "
|
72
|
+
it "removes priority from an item" do
|
73
73
|
todo = Todotxt::Todo.new "(A) an item"
|
74
74
|
|
75
75
|
todo.prioritize
|
@@ -78,7 +78,7 @@ describe Todotxt::Todo do
|
|
78
78
|
todo.priority.should eql nil
|
79
79
|
end
|
80
80
|
|
81
|
-
it "
|
81
|
+
it "appends text to an item" do
|
82
82
|
todo = Todotxt::Todo.new "an item"
|
83
83
|
|
84
84
|
todo.append "more text"
|
@@ -86,7 +86,7 @@ describe Todotxt::Todo do
|
|
86
86
|
todo.to_s.should eql "an item more text"
|
87
87
|
end
|
88
88
|
|
89
|
-
it "
|
89
|
+
it "prepends text to an item" do
|
90
90
|
todo = Todotxt::Todo.new "an item"
|
91
91
|
|
92
92
|
todo.prepend "more text"
|
@@ -94,7 +94,7 @@ describe Todotxt::Todo do
|
|
94
94
|
todo.to_s.should eql "more text an item"
|
95
95
|
end
|
96
96
|
|
97
|
-
it "
|
97
|
+
it "preserves priority when prepending text to an item" do
|
98
98
|
todo = Todotxt::Todo.new "(A) an item"
|
99
99
|
|
100
100
|
todo.prepend "more text"
|
@@ -103,7 +103,7 @@ describe Todotxt::Todo do
|
|
103
103
|
todo.priority.should eql "A"
|
104
104
|
end
|
105
105
|
|
106
|
-
it "
|
106
|
+
it "replaces an item with new text" do
|
107
107
|
todo = Todotxt::Todo.new "an item"
|
108
108
|
|
109
109
|
todo.replace "(A) a replacement item"
|
@@ -112,14 +112,14 @@ describe Todotxt::Todo do
|
|
112
112
|
todo.priority.should eql "A"
|
113
113
|
end
|
114
114
|
|
115
|
-
it "
|
115
|
+
it "sorts based on line number" do
|
116
116
|
todo1 = Todotxt::Todo.new "an item 1", 1
|
117
117
|
todo2 = Todotxt::Todo.new "an item 2", 2
|
118
118
|
|
119
119
|
(todo1 <=> todo2).should eql -1
|
120
120
|
end
|
121
121
|
|
122
|
-
it "
|
122
|
+
it "values items with priority higher when sorting" do
|
123
123
|
todo1 = Todotxt::Todo.new "an item 1", 1
|
124
124
|
todo2 = Todotxt::Todo.new "(A) an item 2", 2
|
125
125
|
|
data/spec/todolist_spec.rb
CHANGED
@@ -4,10 +4,10 @@ describe Todotxt::TodoList do
|
|
4
4
|
|
5
5
|
describe "with simple list" do
|
6
6
|
before :each do
|
7
|
-
@list = Todotxt::TodoList.new File.join(File.dirname(__FILE__), "
|
7
|
+
@list = Todotxt::TodoList.new File.join(File.dirname(__FILE__), "fixtures", "simple_todo.txt")
|
8
8
|
end
|
9
9
|
|
10
|
-
it "
|
10
|
+
it "parses a file on creation" do
|
11
11
|
@list.todos[0].to_s.should eql "First item"
|
12
12
|
@list.todos[1].to_s.should eql "Second item"
|
13
13
|
@list.todos[2].to_s.should eql "Third item"
|
@@ -19,50 +19,50 @@ describe Todotxt::TodoList do
|
|
19
19
|
@list.todos[3].line.should eql 4
|
20
20
|
end
|
21
21
|
|
22
|
-
it "
|
22
|
+
it "adds a new item" do
|
23
23
|
@list.add "Fourth item"
|
24
24
|
|
25
25
|
@list.todos[4].to_s.should eql "Fourth item"
|
26
26
|
@list.todos[4].line.should eql 5
|
27
27
|
end
|
28
28
|
|
29
|
-
it "
|
29
|
+
it "removes an item" do
|
30
30
|
@list.remove 1
|
31
31
|
|
32
32
|
@list.todos[0].to_s.should eql "Second item"
|
33
33
|
end
|
34
34
|
|
35
|
-
it "
|
35
|
+
it "finds item by line" do
|
36
36
|
todo = @list.find_by_line 3
|
37
37
|
|
38
38
|
todo.to_s.should eql "Third item"
|
39
39
|
end
|
40
40
|
|
41
|
-
it "
|
41
|
+
it "filters list when searching" do
|
42
42
|
@list.filter "First"
|
43
43
|
|
44
44
|
@list.todos.count.should eql 1
|
45
45
|
end
|
46
46
|
|
47
|
-
it "
|
47
|
+
it "filters list when searching case-sensitive" do
|
48
48
|
@list.filter "first"
|
49
49
|
|
50
50
|
@list.todos.count.should eql 1
|
51
51
|
end
|
52
52
|
|
53
|
-
it "
|
53
|
+
it "includes done items in search when told to do so" do
|
54
54
|
@list.filter "first", :with_done => true
|
55
55
|
|
56
56
|
@list.todos.count.should eql 2
|
57
57
|
end
|
58
58
|
|
59
|
-
it "
|
59
|
+
it "only includes done items in search when told to do so" do
|
60
60
|
@list.filter "first", :only_done => true
|
61
61
|
|
62
62
|
@list.todos.count.should eql 1
|
63
63
|
end
|
64
64
|
|
65
|
-
it "
|
65
|
+
it "renders plain text" do
|
66
66
|
comparison_string = <<EOF
|
67
67
|
First item
|
68
68
|
Second item
|
@@ -75,22 +75,22 @@ EOF
|
|
75
75
|
|
76
76
|
describe "with complex list" do
|
77
77
|
before :each do
|
78
|
-
@list = Todotxt::TodoList.new File.join(File.dirname(__FILE__), "
|
78
|
+
@list = Todotxt::TodoList.new File.join(File.dirname(__FILE__), "fixtures", "complex_todo.txt")
|
79
79
|
end
|
80
80
|
|
81
|
-
it "
|
81
|
+
it "sorts itself automatically on parse" do
|
82
82
|
@list.todos[0].to_s.should eql "(A) an item"
|
83
83
|
@list.todos[0].line.should eql 3
|
84
84
|
end
|
85
85
|
|
86
|
-
it "
|
86
|
+
it "re-sorts itself after adding a new item" do
|
87
87
|
@list.add "(B) A new item"
|
88
88
|
|
89
89
|
@list.todos[1].to_s.should eql "(B) A new item"
|
90
90
|
@list.todos[1].line.should eql 4
|
91
91
|
end
|
92
92
|
|
93
|
-
it "
|
93
|
+
it "lists all projects and contexts in the list" do
|
94
94
|
@list.projects.should eql ["+project1", "+project2"]
|
95
95
|
@list.contexts.should eql ["@context1", "@context2"]
|
96
96
|
end
|
data/todotxt.gemspec
CHANGED
@@ -18,9 +18,10 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_dependency "thor", "
|
22
|
-
s.add_dependency "rainbow", "
|
23
|
-
s.add_dependency "parseconfig", "
|
21
|
+
s.add_dependency "thor", "~> 0.15.4"
|
22
|
+
s.add_dependency "rainbow", "~> 1.1.4"
|
23
|
+
s.add_dependency "parseconfig", "~> 1.0.2"
|
24
24
|
|
25
|
-
s.add_development_dependency "
|
25
|
+
s.add_development_dependency "rake"
|
26
|
+
s.add_development_dependency "rspec", "~> 2.11.0"
|
26
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: todotxt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,52 +9,63 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-07-17 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70177769396400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.15.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70177769396400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rainbow
|
27
|
-
requirement: &
|
27
|
+
requirement: &70177769395640 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
|
-
- -
|
30
|
+
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.1.
|
32
|
+
version: 1.1.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70177769395640
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: parseconfig
|
38
|
-
requirement: &
|
38
|
+
requirement: &70177769394860 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 1.0.2
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70177769394860
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: &
|
48
|
+
name: rake
|
49
|
+
requirement: &70177769394140 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70177769394140
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rspec
|
60
|
+
requirement: &70177769393240 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 2.11.0
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70177769393240
|
58
69
|
description: Interact with your todo.txt using a Ruby-base command-line tool
|
59
70
|
email:
|
60
71
|
- johan@monospace.se
|
@@ -71,8 +82,6 @@ files:
|
|
71
82
|
- bin/todotxt
|
72
83
|
- conf/todo.txt
|
73
84
|
- conf/todotxt.cfg
|
74
|
-
- fixtures/complex_todo.txt
|
75
|
-
- fixtures/simple_todo.txt
|
76
85
|
- lib/todotxt.rb
|
77
86
|
- lib/todotxt/cli.rb
|
78
87
|
- lib/todotxt/clihelpers.rb
|
@@ -80,6 +89,8 @@ files:
|
|
80
89
|
- lib/todotxt/todo.rb
|
81
90
|
- lib/todotxt/todolist.rb
|
82
91
|
- lib/todotxt/version.rb
|
92
|
+
- spec/fixtures/complex_todo.txt
|
93
|
+
- spec/fixtures/simple_todo.txt
|
83
94
|
- spec/todo_spec.rb
|
84
95
|
- spec/todolist_spec.rb
|
85
96
|
- todotxt.gemspec
|
@@ -95,18 +106,26 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
106
|
- - ! '>='
|
96
107
|
- !ruby/object:Gem::Version
|
97
108
|
version: '0'
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
hash: -265984123705521099
|
98
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
113
|
none: false
|
100
114
|
requirements:
|
101
115
|
- - ! '>='
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '0'
|
118
|
+
segments:
|
119
|
+
- 0
|
120
|
+
hash: -265984123705521099
|
104
121
|
requirements: []
|
105
122
|
rubyforge_project: todotxt
|
106
|
-
rubygems_version: 1.8.
|
123
|
+
rubygems_version: 1.8.10
|
107
124
|
signing_key:
|
108
125
|
specification_version: 3
|
109
126
|
summary: todo.txt with a Ruby flair
|
110
127
|
test_files:
|
128
|
+
- spec/fixtures/complex_todo.txt
|
129
|
+
- spec/fixtures/simple_todo.txt
|
111
130
|
- spec/todo_spec.rb
|
112
131
|
- spec/todolist_spec.rb
|