todo-txt 0.8 → 0.9
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/lib/todo-txt.rb +0 -3
- data/lib/todo-txt/list.rb +49 -35
- data/lib/todo-txt/options.rb +11 -0
- data/lib/todo-txt/syntax.rb +30 -20
- data/lib/todo-txt/task.rb +17 -16
- data/spec/data/tasks.txt +3 -0
- data/spec/todo-txt/list_spec.rb +17 -0
- data/spec/todo-txt/syntax_spec.rb +22 -22
- data/spec/todo-txt/task_spec.rb +17 -0
- data/todo-txt.gemspec +2 -4
- data/todo.txt +13 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04e209879cbf8434759e4343c03bdbb2b48a7e3f
|
4
|
+
data.tar.gz: bad9b8396a6d32ef8eb8f647394de850d5c0a658
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d5599684ab23946adde905819a231f75d38029780c49e0771acd0258a6622fd88d5edd1c0e5ff2d6415b1e359047b7b6fbef8cd684c701ce94fdafa972d2b31
|
7
|
+
data.tar.gz: 9b7c601dad7b1a07541fea804b06a9c12490406501a7173b4e2e0dfaf26d5da320a7605960f4e8b9d5ba5f66d10dac3892c50bee9e2676d95fbb8df295f7c014
|
data/.rubocop.yml
ADDED
data/lib/todo-txt.rb
CHANGED
data/lib/todo-txt/list.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
module Todo
|
2
|
+
# Initializes a Todo List object with a path to the corresponding todo.txt
|
3
|
+
# file. For example, if your todo.txt file is located at:
|
4
|
+
#
|
5
|
+
# /home/sam/Dropbox/todo/todo.txt
|
6
|
+
#
|
7
|
+
# You would initialize this object like:
|
8
|
+
#
|
9
|
+
# list = Todo::List.new "/home/sam/Dropbox/todo/todo-txt"
|
10
|
+
#
|
11
|
+
# Alternately, you can initialize this object with an array of strings or
|
12
|
+
# tasks. If the array is of strings, the strings will be converted into
|
13
|
+
# tasks. You can supply a mixed list of string and tasks if you wish.
|
14
|
+
#
|
15
|
+
# Example:
|
16
|
+
#
|
17
|
+
# array = Array.new
|
18
|
+
# array.push "(A) A string task!"
|
19
|
+
# array.push Todo::Task.new("(A) An actual task!")
|
20
|
+
#
|
21
|
+
# list = Todo::List.new array
|
2
22
|
class List < Array
|
3
|
-
|
4
|
-
# file. For example, if your todo.txt file is located at:
|
5
|
-
#
|
6
|
-
# /home/sam/Dropbox/todo/todo.txt
|
7
|
-
#
|
8
|
-
# You would initialize this object like:
|
9
|
-
#
|
10
|
-
# list = Todo::List.new "/home/sam/Dropbox/todo/todo-txt"
|
11
|
-
#
|
12
|
-
# Alternately, you can initialize this object with an array of strings or
|
13
|
-
# tasks. If the array is of strings, the strings will be converted into
|
14
|
-
# tasks. You can supply a mixed list of string and tasks if you wish.
|
15
|
-
#
|
16
|
-
# Example:
|
17
|
-
#
|
18
|
-
# array = Array.new
|
19
|
-
# array.push "(A) A string task!"
|
20
|
-
# array.push Todo::Task.new("(A) An actual task!")
|
21
|
-
#
|
22
|
-
# list = Todo::List.new array
|
23
|
-
def initialize list
|
23
|
+
def initialize(list)
|
24
24
|
if list.is_a? Array
|
25
25
|
# No file path was given.
|
26
26
|
@path = nil
|
@@ -29,10 +29,10 @@ module Todo
|
|
29
29
|
list.each do |task|
|
30
30
|
# If it's a string, make a new task out of it.
|
31
31
|
if task.is_a? String
|
32
|
-
|
32
|
+
push Task.new task
|
33
33
|
# If it's a task, just add it.
|
34
34
|
elsif task.is_a? Todo::Task
|
35
|
-
|
35
|
+
push task
|
36
36
|
end
|
37
37
|
end
|
38
38
|
elsif list.is_a? String
|
@@ -41,16 +41,14 @@ module Todo
|
|
41
41
|
# Read in lines from file, create Todo::Tasks out of them and push them
|
42
42
|
# onto self.
|
43
43
|
File.open(list) do |file|
|
44
|
-
file.each_line { |line|
|
44
|
+
file.each_line { |line| push Task.new(line) }
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
49
|
# The path to the todo.txt file that you supplied when you created the
|
50
50
|
# Todo::List object.
|
51
|
-
|
52
|
-
@path
|
53
|
-
end
|
51
|
+
attr_reader :path
|
54
52
|
|
55
53
|
# Filters the list by priority and returns a new list.
|
56
54
|
#
|
@@ -58,8 +56,8 @@ module Todo
|
|
58
56
|
#
|
59
57
|
# list = Todo::List.new "/path/to/list"
|
60
58
|
# list.by_priority "A" #=> Will be a new list with only priority A tasks
|
61
|
-
def by_priority
|
62
|
-
|
59
|
+
def by_priority(priority)
|
60
|
+
List.new(select { |task| task.priority == priority })
|
63
61
|
end
|
64
62
|
|
65
63
|
# Filters the list by context and returns a new list.
|
@@ -69,8 +67,8 @@ module Todo
|
|
69
67
|
# list = Todo::List.new "/path/to/list"
|
70
68
|
# list.by_context "@context" #=> Will be a new list with only tasks
|
71
69
|
# containing "@context"
|
72
|
-
def by_context
|
73
|
-
|
70
|
+
def by_context(context)
|
71
|
+
List.new(select { |task| task.contexts.include? context })
|
74
72
|
end
|
75
73
|
|
76
74
|
# Filters the list by project and returns a new list.
|
@@ -80,8 +78,8 @@ module Todo
|
|
80
78
|
# list = Todo::List.new "/path/to/list"
|
81
79
|
# list.by_project "+project" #=> Will be a new list with only tasks
|
82
80
|
# containing "+project"
|
83
|
-
def by_project
|
84
|
-
|
81
|
+
def by_project(project)
|
82
|
+
List.new(select { |task| task.projects.include? project })
|
85
83
|
end
|
86
84
|
|
87
85
|
# Filters the list by completed tasks and returns a new list.
|
@@ -92,7 +90,7 @@ module Todo
|
|
92
90
|
# list.by_done #=> Will be a new list with only tasks marked with
|
93
91
|
# an [x]
|
94
92
|
def by_done
|
95
|
-
|
93
|
+
List.new(select(&:done?))
|
96
94
|
end
|
97
95
|
|
98
96
|
# Filters the list by incomplete tasks and returns a new list.
|
@@ -102,7 +100,23 @@ module Todo
|
|
102
100
|
# list = Todo::List.new "/path/to/list"
|
103
101
|
# list.by_not_done #=> Will be a new list with only incomplete tasks
|
104
102
|
def by_not_done
|
105
|
-
|
103
|
+
List.new(select { |task| task.done? == false })
|
104
|
+
end
|
105
|
+
|
106
|
+
# Saves the list to the original file location.
|
107
|
+
#
|
108
|
+
# Warning: This is a destructive operation and will overwrite what is
|
109
|
+
# currently there.
|
110
|
+
#
|
111
|
+
# If no `path` is specified in the constructor then an error is raised.
|
112
|
+
def save!
|
113
|
+
raise "No path specified." unless path
|
114
|
+
|
115
|
+
File.open(path, 'w') do |outfile|
|
116
|
+
each do |task|
|
117
|
+
outfile.puts(task.to_s)
|
118
|
+
end
|
119
|
+
end
|
106
120
|
end
|
107
121
|
end
|
108
122
|
end
|
data/lib/todo-txt/options.rb
CHANGED
@@ -12,12 +12,23 @@ module Todo
|
|
12
12
|
yield(options_instance)
|
13
13
|
end
|
14
14
|
|
15
|
+
# Options for default preferences and library settings that can be customized
|
16
|
+
# by clients of the gem.
|
15
17
|
class Options
|
16
18
|
# Require all done tasks to have a `completed_on` date. True by default.
|
17
19
|
#
|
18
20
|
# - When `true`, tasks with invalid dates are considered not done.
|
19
21
|
# - When `false`, tasks starting with `x ` are considered done.
|
20
22
|
#
|
23
|
+
# Example:
|
24
|
+
#
|
25
|
+
# Todo.customize do |opts|
|
26
|
+
# opts.require_completed_on = false
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# task = Todo::Task.new("x This is done!")
|
30
|
+
# task.done? # => true
|
31
|
+
#
|
21
32
|
# @return [Boolean]
|
22
33
|
attr_accessor :require_completed_on
|
23
34
|
|
data/lib/todo-txt/syntax.rb
CHANGED
@@ -1,35 +1,45 @@
|
|
1
1
|
module Todo
|
2
|
+
# Parsing and extraction of the core syntax fragments in todo.txt lines.
|
2
3
|
module Syntax
|
3
|
-
# The
|
4
|
-
CONTEXTS_PATTERN = /(?:\s+|^)@[^\s]
|
4
|
+
# The regex used to match contexts.
|
5
|
+
CONTEXTS_PATTERN = /(?:\s+|^)@[^\s]+/
|
5
6
|
|
6
7
|
# The regex used to match projects.
|
7
|
-
PROJECTS_PATTERN = /(?:\s+|^)\+[^\s]
|
8
|
+
PROJECTS_PATTERN = /(?:\s+|^)\+[^\s]+/
|
8
9
|
|
9
10
|
# The regex used to match priorities.
|
10
11
|
PRIORITY_PATTERN = /(?:^|\s+)\(([A-Za-z])\)\s+/
|
11
12
|
|
12
13
|
# The regex used to match creation date.
|
13
|
-
CREATED_ON_PATTERN = /(?:^|-\d{2}\s|\)\s)(\d{4}-\d{2}-\d{2})\s
|
14
|
+
CREATED_ON_PATTERN = /(?:^|-\d{2}\s|\)\s)(\d{4}-\d{2}-\d{2})\s/
|
14
15
|
|
15
16
|
# The regex used to match completion.
|
16
|
-
COMPLETED_ON_PATTERN = /^x\s+(\d{4}-\d{2}-\d{2})\s
|
17
|
+
COMPLETED_ON_PATTERN = /^x\s+(\d{4}-\d{2}-\d{2})\s+/
|
17
18
|
|
18
19
|
# The regex used to match due date.
|
19
|
-
DUE_ON_PATTERN = /(?:due:)(\d{4}-\d{2}-\d{2})(?:\s+|$)/i
|
20
|
+
DUE_ON_PATTERN = /(?:due:)(\d{4}-\d{2}-\d{2})(?:\s+|$)/i
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
# Extracts the readable text content of a task line, stripping out all the
|
23
|
+
# discrete pieces of metadata (priority, dates, completion flag, projects,
|
24
|
+
# contexts, etc).
|
25
|
+
#
|
26
|
+
# @param line [String] the todo item to be processed
|
27
|
+
# @return [String] the text content of the item
|
28
|
+
def extract_item_text(line)
|
29
|
+
line.gsub(COMPLETED_ON_PATTERN, '')
|
30
|
+
.gsub(PRIORITY_PATTERN, '')
|
31
|
+
.gsub(CREATED_ON_PATTERN, '')
|
32
|
+
.gsub(CONTEXTS_PATTERN, '')
|
33
|
+
.gsub(PROJECTS_PATTERN, '')
|
34
|
+
.gsub(DUE_ON_PATTERN, '')
|
35
|
+
.strip
|
30
36
|
end
|
31
37
|
|
32
|
-
|
38
|
+
# Extracts the priority indicator from the task line.
|
39
|
+
#
|
40
|
+
# @param line [String] the todo item to be processed
|
41
|
+
# @return [String] the character (from A-Z) representing the priority
|
42
|
+
def extract_priority(line)
|
33
43
|
line.match(PRIORITY_PATTERN)[1] if line =~ PRIORITY_PATTERN
|
34
44
|
end
|
35
45
|
|
@@ -38,7 +48,7 @@ module Todo
|
|
38
48
|
#
|
39
49
|
# @param line [String] the todo item to be processed
|
40
50
|
# @return [Date] the created date of the line
|
41
|
-
def
|
51
|
+
def extract_created_on(line)
|
42
52
|
date = line.match CREATED_ON_PATTERN
|
43
53
|
begin
|
44
54
|
Date.parse(date[1]) if date
|
@@ -80,7 +90,7 @@ module Todo
|
|
80
90
|
#
|
81
91
|
# @param line [String] the todo item to be processed
|
82
92
|
# @return [Date] the due date of the line
|
83
|
-
def
|
93
|
+
def extract_due_on_date(line)
|
84
94
|
date = DUE_ON_PATTERN.match(line)
|
85
95
|
begin
|
86
96
|
Date.parse(date[1]) if date
|
@@ -94,7 +104,7 @@ module Todo
|
|
94
104
|
# @param [String] line Line of text encoding a single task
|
95
105
|
# @return [Array<String>] List of context tags
|
96
106
|
def extract_contexts(line)
|
97
|
-
line.scan(CONTEXTS_PATTERN).map
|
107
|
+
line.scan(CONTEXTS_PATTERN).map(&:strip)
|
98
108
|
end
|
99
109
|
|
100
110
|
# Extract the list of `+project` tags out of the task line.
|
@@ -102,7 +112,7 @@ module Todo
|
|
102
112
|
# @param [String] line Line of text encoding a single task
|
103
113
|
# @return [Array<String>] List of project tags
|
104
114
|
def extract_projects(line)
|
105
|
-
line.scan(PROJECTS_PATTERN).map
|
115
|
+
line.scan(PROJECTS_PATTERN).map(&:strip)
|
106
116
|
end
|
107
117
|
end
|
108
118
|
end
|
data/lib/todo-txt/task.rb
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
require 'date'
|
2
2
|
|
3
3
|
module Todo
|
4
|
+
# Creates a new task. The argument that you pass in must be the string
|
5
|
+
# representation of a task.
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
#
|
9
|
+
# task = Todo::Task.new("(A) A high priority task!")
|
4
10
|
class Task
|
5
11
|
include Comparable
|
6
12
|
include Todo::Logger
|
7
13
|
include Todo::Syntax
|
8
14
|
|
9
|
-
|
10
|
-
# representation of a task.
|
11
|
-
#
|
12
|
-
# Example:
|
13
|
-
#
|
14
|
-
# task = Todo::Task.new("(A) A high priority task!")
|
15
|
-
def initialize task
|
15
|
+
def initialize(task)
|
16
16
|
@orig = task
|
17
|
-
@priority
|
18
|
-
@
|
17
|
+
@priority = extract_priority(orig)
|
18
|
+
@created_on = extract_created_on(orig)
|
19
|
+
@due_on = extract_due_on_date(orig)
|
19
20
|
@contexts ||= extract_contexts(orig)
|
20
21
|
@projects ||= extract_projects(orig)
|
21
22
|
|
@@ -110,7 +111,7 @@ module Todo
|
|
110
111
|
# task = Todo::Task.new "(A) @test Testing!"
|
111
112
|
# task.text #=> "Testing!"
|
112
113
|
def text
|
113
|
-
@text ||=
|
114
|
+
@text ||= extract_item_text(orig)
|
114
115
|
end
|
115
116
|
|
116
117
|
# Returns the task's creation date, if any.
|
@@ -197,7 +198,7 @@ module Todo
|
|
197
198
|
def undo!
|
198
199
|
@completed_on = nil
|
199
200
|
@is_completed = false
|
200
|
-
@priority =
|
201
|
+
@priority = extract_priority(orig)
|
201
202
|
end
|
202
203
|
|
203
204
|
# Increases the priority until A. If it's nil, it sets it to A.
|
@@ -271,15 +272,15 @@ module Todo
|
|
271
272
|
#
|
272
273
|
# task2 > task1
|
273
274
|
# # => false
|
274
|
-
def <=>
|
275
|
-
if
|
275
|
+
def <=>(other)
|
276
|
+
if priority.nil? && other.priority.nil?
|
276
277
|
0
|
277
|
-
elsif
|
278
|
+
elsif other.priority.nil?
|
278
279
|
1
|
279
|
-
elsif
|
280
|
+
elsif priority.nil?
|
280
281
|
-1
|
281
282
|
else
|
282
|
-
|
283
|
+
other.priority <=> priority
|
283
284
|
end
|
284
285
|
end
|
285
286
|
end
|
data/spec/data/tasks.txt
ADDED
data/spec/todo-txt/list_spec.rb
CHANGED
@@ -2,6 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Todo::List do
|
4
4
|
let(:path) { File.dirname(__FILE__) + '/../data/todo.txt' }
|
5
|
+
let(:mutable_path) { File.dirname(__FILE__) + '/../data/tasks.txt' }
|
5
6
|
let(:list) { Todo::List.new(path) }
|
6
7
|
|
7
8
|
context 'create with an array' do
|
@@ -20,6 +21,22 @@ describe Todo::List do
|
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
24
|
+
context 'create and save from file' do
|
25
|
+
it 'successfully writes back changes' do
|
26
|
+
backup = Todo::List.new(mutable_path)
|
27
|
+
|
28
|
+
tasks = Todo::List.new(mutable_path)
|
29
|
+
tasks.each(&:do!)
|
30
|
+
tasks.save!
|
31
|
+
|
32
|
+
result = Todo::List.new(mutable_path)
|
33
|
+
|
34
|
+
expect(result.by_done.count).to eq(3)
|
35
|
+
|
36
|
+
backup.save!
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
23
40
|
it 'accepts a mix of tasks and strings' do
|
24
41
|
l = Todo::List.new([
|
25
42
|
"A task!",
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Todo::Syntax do
|
4
4
|
include Todo::Syntax
|
5
5
|
|
6
|
-
describe '#
|
6
|
+
describe '#extract_contexts' do
|
7
7
|
specify 'empty task' do
|
8
8
|
expect(extract_contexts('')).to eq([])
|
9
9
|
end
|
@@ -21,7 +21,7 @@ describe Todo::Syntax do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
describe '#
|
24
|
+
describe '#extract_projects' do
|
25
25
|
specify 'empty task' do
|
26
26
|
expect(extract_projects('')).to eq([])
|
27
27
|
end
|
@@ -39,43 +39,43 @@ describe Todo::Syntax do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
describe '#
|
42
|
+
describe '#extract_priority' do
|
43
43
|
specify 'empty task' do
|
44
|
-
expect(
|
44
|
+
expect(extract_priority('')).to be nil
|
45
45
|
end
|
46
46
|
|
47
47
|
specify 'task without priority' do
|
48
|
-
expect(
|
48
|
+
expect(extract_priority('something to do')).to be nil
|
49
49
|
end
|
50
50
|
|
51
51
|
specify 'task with priority A' do
|
52
|
-
expect(
|
52
|
+
expect(extract_priority('(A) something to do')).to eq('A')
|
53
53
|
end
|
54
54
|
|
55
55
|
specify 'task with priority B' do
|
56
|
-
expect(
|
56
|
+
expect(extract_priority('(B) something to do')).to eq('B')
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
describe '#
|
60
|
+
describe '#extract_created_on' do
|
61
61
|
specify 'empty task' do
|
62
|
-
expect(
|
62
|
+
expect(extract_created_on('')).to be nil
|
63
63
|
end
|
64
64
|
|
65
65
|
specify 'task without date' do
|
66
|
-
expect(
|
66
|
+
expect(extract_created_on('something to do')).to be nil
|
67
67
|
end
|
68
68
|
|
69
69
|
specify 'task with created date' do
|
70
|
-
expect(
|
70
|
+
expect(extract_created_on('2016-03-29 something to do')).to eq(Date.new(2016, 03, 29))
|
71
71
|
end
|
72
72
|
|
73
73
|
specify 'prioritised task with created date' do
|
74
|
-
expect(
|
74
|
+
expect(extract_created_on('(A) 2016-03-29 something to do')).to eq(Date.new(2016, 03, 29))
|
75
75
|
end
|
76
76
|
|
77
77
|
specify 'date included in task text' do
|
78
|
-
expect(
|
78
|
+
expect(extract_created_on('(A) something to do on 2016-03-29')).to be nil
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -115,35 +115,35 @@ describe Todo::Syntax do
|
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
|
-
describe '#
|
118
|
+
describe '#extract_due_on_date' do
|
119
119
|
specify 'empty task' do
|
120
|
-
expect(
|
120
|
+
expect(extract_due_on_date('')).to be nil
|
121
121
|
end
|
122
122
|
|
123
123
|
specify 'task without due date' do
|
124
|
-
expect(
|
124
|
+
expect(extract_due_on_date('something to do')).to be nil
|
125
125
|
end
|
126
126
|
|
127
127
|
specify 'task with due date' do
|
128
|
-
expect(
|
128
|
+
expect(extract_due_on_date('something to do due:2016-03-30')).to eq(Date.new(2016, 03, 30))
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
describe '#
|
132
|
+
describe '#extract_item_text' do
|
133
133
|
specify 'empty task' do
|
134
|
-
expect(
|
134
|
+
expect(extract_item_text('')).to eq('')
|
135
135
|
end
|
136
136
|
|
137
137
|
specify 'task without markup' do
|
138
|
-
expect(
|
138
|
+
expect(extract_item_text('something to do')).to eq('something to do')
|
139
139
|
end
|
140
140
|
|
141
141
|
specify 'task with date, priority, projects and context' do
|
142
|
-
expect(
|
142
|
+
expect(extract_item_text('(A) 2016-03-29 something to do +experiment @work')).to eq('something to do')
|
143
143
|
end
|
144
144
|
|
145
145
|
specify 'completed task with projects and context' do
|
146
|
-
expect(
|
146
|
+
expect(extract_item_text('x 2016-03-30 2016-03-29 something to do +experiment @work')).to eq('something to do')
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
data/spec/todo-txt/task_spec.rb
CHANGED
@@ -289,6 +289,23 @@ describe Todo::Task do
|
|
289
289
|
expect(task.completed_on).to eq(Date.parse('8th December 2013'))
|
290
290
|
end
|
291
291
|
end
|
292
|
+
|
293
|
+
context 'Options#require_completed_on' do
|
294
|
+
before do
|
295
|
+
Todo.customize do |options|
|
296
|
+
options.require_completed_on = false
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
it 'should allow completion without date when option is set' do
|
301
|
+
task = Todo::Task.new('x This is done!')
|
302
|
+
expect(task.done?).to be true
|
303
|
+
end
|
304
|
+
|
305
|
+
after do
|
306
|
+
Todo.options.reset
|
307
|
+
end
|
308
|
+
end
|
292
309
|
end
|
293
310
|
|
294
311
|
describe 'Due dates:' do
|
data/todo-txt.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
|
-
s.name =
|
3
|
-
s.version = '0.
|
2
|
+
s.name = 'todo-txt'
|
3
|
+
s.version = '0.9'
|
4
4
|
s.authors = ["Sam Rose"]
|
5
5
|
s.email = %q{samwho@lbak.co.uk}
|
6
6
|
s.summary = %q{A client library for parsing todo.txt files.}
|
@@ -8,7 +8,5 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.description = %q{Allows for simple parsing of todo.txt files, as per Gina Trapani's todo.txt project.}
|
9
9
|
s.required_ruby_version = '>= 2.0'
|
10
10
|
s.license = 'GPL-2'
|
11
|
-
|
12
|
-
# Add all files to the files parameter.
|
13
11
|
s.files = `git ls-files`.split(/\n/)
|
14
12
|
end
|
data/todo.txt
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
x 2016-04-21 modify list#save! to work with windows line separators +bug
|
2
|
+
determine correct/expected behaviour for missing file paths +feature +api
|
3
|
+
dirty flag on lists that have modifications after loading +feature
|
4
|
+
extract file handling into separate IO-like module +refactor +api
|
5
|
+
implement enumerable API on list rather than inherit from array +api
|
6
|
+
list operations should be algebraically closed +api
|
7
|
+
include rubocop in travis builds +build
|
8
|
+
use << operation to move tasks between lists +api +feature
|
9
|
+
create github issue with roadmap for 1.0 release +feature +api
|
10
|
+
consider rewriting file write tests with mocking and stringio +refactor +build
|
11
|
+
remove deprecated date method from task +api
|
12
|
+
pass in options as an instance rather than make it always global +refactor +api
|
13
|
+
save a backup of an existing todo file when the IO object is read in +feature
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: todo-txt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.9'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Rose
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Allows for simple parsing of todo.txt files, as per Gina Trapani's todo.txt
|
14
14
|
project.
|
@@ -19,6 +19,7 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- ".gemtest"
|
21
21
|
- ".gitignore"
|
22
|
+
- ".rubocop.yml"
|
22
23
|
- ".travis.yml"
|
23
24
|
- Gemfile
|
24
25
|
- LICENSE
|
@@ -30,6 +31,7 @@ files:
|
|
30
31
|
- lib/todo-txt/options.rb
|
31
32
|
- lib/todo-txt/syntax.rb
|
32
33
|
- lib/todo-txt/task.rb
|
34
|
+
- spec/data/tasks.txt
|
33
35
|
- spec/data/todo.txt
|
34
36
|
- spec/spec_helper.rb
|
35
37
|
- spec/todo-txt/list_spec.rb
|
@@ -38,6 +40,7 @@ files:
|
|
38
40
|
- spec/todo-txt/syntax_spec.rb
|
39
41
|
- spec/todo-txt/task_spec.rb
|
40
42
|
- todo-txt.gemspec
|
43
|
+
- todo.txt
|
41
44
|
homepage: http://github.com/samwho/todo-txt-gem
|
42
45
|
licenses:
|
43
46
|
- GPL-2
|