todo-txt 0.1 → 0.1.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.
- data/README.md +3 -9
- data/gems/todo-txt-0.1.gem +0 -0
- data/todo-txt.gemspec +2 -2
- metadata +3 -2
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
This is a Ruby client library for Gina Trapani's [todo.txt](https://github.com/ginatrapani/todo.txt-cli/). It allows for easy parsing of task lists and tasks in the todo.txt format.
|
4
4
|
|
5
|
+
Find the project on GitHub: [http://github.com/samwho/todo-txt-gem](http://github.com/samwho/todo-txt-gem).
|
6
|
+
|
5
7
|
# Installation
|
6
8
|
|
7
9
|
Installation is very simple. The project is packaged as a Ruby gem and can be installed by running:
|
@@ -14,11 +16,9 @@ Installation is very simple. The project is packaged as a Ruby gem and can be in
|
|
14
16
|
|
15
17
|
A `Todo::List` object encapsulates your todo.txt file. You initialise it by passing the path to your todo.txt to the constructor:
|
16
18
|
|
17
|
-
``` ruby
|
18
19
|
require 'todo-txt'
|
19
20
|
|
20
21
|
list = Todo::List.new "path/to/todo.txt"
|
21
|
-
```
|
22
22
|
|
23
23
|
`Todo::List` subclasses `Array` so it has all of the standard methods that are available on an array. It is, basically, an array of `Todo::Task` items.
|
24
24
|
|
@@ -26,8 +26,7 @@ A `Todo::List` object encapsulates your todo.txt file. You initialise it by pass
|
|
26
26
|
|
27
27
|
You can filter your todo list by priority, project, context or a combination of all three with ease.
|
28
28
|
|
29
|
-
|
30
|
-
require 'todo-txt
|
29
|
+
require 'todo-txt'
|
31
30
|
|
32
31
|
list = Todo::List.new "path/to/todo.txt"
|
33
32
|
|
@@ -43,13 +42,11 @@ You can filter your todo list by priority, project, context or a combination of
|
|
43
42
|
|
44
43
|
# And you can combine these, like so
|
45
44
|
list.by_project("+manhatten").by_priority("B")
|
46
|
-
```
|
47
45
|
|
48
46
|
## Todo::Task
|
49
47
|
|
50
48
|
A `Todo::Task` object can be created from a standard task string if you don't want to use the `Todo::List` approach (though using `Todo::List` is recommended).
|
51
49
|
|
52
|
-
``` ruby
|
53
50
|
require 'todo-txt'
|
54
51
|
|
55
52
|
task = Todo::Task.new "(A) This task is top priority! +project @context"
|
@@ -68,13 +65,11 @@ A `Todo::Task` object can be created from a standard task string if you don't wa
|
|
68
65
|
|
69
66
|
task.orig
|
70
67
|
# => "(A) This task is top priority! +project @context"
|
71
|
-
```
|
72
68
|
|
73
69
|
### Comparable
|
74
70
|
|
75
71
|
The `Todo::Task` object includes the `Comparable` mixin. It compares with other tasks and sorts by priority in descending order.
|
76
72
|
|
77
|
-
``` ruby
|
78
73
|
task1 = Todo::Task.new "(A) Priority A."
|
79
74
|
task2 = Todo::Task.new "(B) Priority B."
|
80
75
|
|
@@ -86,7 +81,6 @@ The `Todo::Task` object includes the `Comparable` mixin. It compares with other
|
|
86
81
|
|
87
82
|
task2 > task1
|
88
83
|
# => false
|
89
|
-
```
|
90
84
|
|
91
85
|
Tasks without a priority will always be less than a task with a priority.
|
92
86
|
|
Binary file
|
data/todo-txt.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{todo-txt}
|
3
|
-
s.version = "0.1"
|
3
|
+
s.version = "0.1.1"
|
4
4
|
s.date = %q{2011-08-19}
|
5
5
|
s.authors = ["Sam Rose"]
|
6
6
|
s.email = %q{samwho@lbak.co.uk}
|
7
7
|
s.summary = %q{A client library for parsing todo.txt files.}
|
8
|
-
s.homepage = %q{http://
|
8
|
+
s.homepage = %q{http://github.com/samwho/todo-txt-gem}
|
9
9
|
s.description = %q{Allows for simple parsing of todo.txt files, as per Gina Trapani's todo.txt project.}
|
10
10
|
s.required_ruby_version = '>= 1.9.2'
|
11
11
|
s.license = 'GPL-2'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: todo-txt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -23,11 +23,12 @@ files:
|
|
23
23
|
- spec/todo-txt/task_spec.rb
|
24
24
|
- spec/data/todo.txt
|
25
25
|
- spec/spec_helper.rb
|
26
|
+
- gems/todo-txt-0.1.gem
|
26
27
|
- todo-txt.gemspec
|
27
28
|
- lib/todo-txt/list.rb
|
28
29
|
- lib/todo-txt/task.rb
|
29
30
|
- lib/todo-txt.rb
|
30
|
-
homepage: http://
|
31
|
+
homepage: http://github.com/samwho/todo-txt-gem
|
31
32
|
licenses:
|
32
33
|
- GPL-2
|
33
34
|
post_install_message:
|