todo-jsonl 0.1.25 → 0.1.28
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/bin/todo.rb +19 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2869302296a5a0ab3af889b0a76926cfba6d59552d5e4103524dae1ae3e7fd50
|
4
|
+
data.tar.gz: f2d7d03e8b62139d3197386c44391caf4a9d4fae545012389272cebdca61c3d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40c72337ffd6a818adf28ef001cbd3b4f365af92d1fecd9a36ea361522a2125d83500ed76d4633df228c2c87a987083b08541452e7129af914452e7ca6652563
|
7
|
+
data.tar.gz: 6f42e59df9b34c140f3c6bba11010f0b6a3f7a3c45d1c7b23d5ded213ee2562e62a963b3e889a6886b97ff991e49e78af6efccf898fd951220c1cad8bcb2f66d
|
data/bin/todo.rb
CHANGED
@@ -240,56 +240,59 @@ class Todo
|
|
240
240
|
update_function.call(tasks[item])
|
241
241
|
tasks[item][:modified] = @today.strftime(DATE_FORMAT)
|
242
242
|
write_tasks(tasks)
|
243
|
-
|
243
|
+
case post_action
|
244
|
+
when :show then show(item, tasks)
|
245
|
+
when :list then list(tasks)
|
246
|
+
end
|
244
247
|
end
|
245
248
|
|
246
249
|
def append(item, text = '')
|
247
|
-
update_task
|
250
|
+
update_task(item, :list, lambda do |task|
|
248
251
|
task[:title] = [task[:title], text].join(' ')
|
249
252
|
postprocess_tags(task)
|
250
|
-
|
253
|
+
end)
|
251
254
|
end
|
252
255
|
|
253
256
|
def rename(item, text)
|
254
|
-
update_task
|
257
|
+
update_task(item, :list, lambda do |task|
|
255
258
|
task[:title] = text
|
256
259
|
postprocess_tags(task)
|
257
|
-
|
260
|
+
end)
|
258
261
|
end
|
259
262
|
|
260
263
|
def delete(item)
|
261
264
|
tasks = load_tasks(item)
|
262
265
|
tasks.delete(item)
|
263
266
|
write_tasks(tasks)
|
264
|
-
list
|
267
|
+
list
|
265
268
|
end
|
266
269
|
|
267
270
|
def change_state(item, state, note = nil)
|
268
|
-
update_task
|
271
|
+
update_task(item, :list, lambda do |task|
|
269
272
|
task[:state] = state
|
270
273
|
if !note.nil? && !note.empty?
|
271
274
|
task[:note] ||= []
|
272
275
|
task[:note].push(note)
|
273
276
|
end
|
274
|
-
|
277
|
+
end)
|
275
278
|
end
|
276
279
|
|
277
280
|
def set_priority(item, note = nil)
|
278
|
-
update_task
|
281
|
+
update_task(item, :list, lambda do |task|
|
279
282
|
task[:priority] = !task[:priority]
|
280
283
|
task.delete(:priority) if !task[:priority]
|
281
284
|
if !note.nil? && !note.empty?
|
282
285
|
task[:note] ||= []
|
283
286
|
task[:note].push(note)
|
284
287
|
end
|
285
|
-
|
288
|
+
end)
|
286
289
|
end
|
287
290
|
|
288
291
|
def due_date(item, date = '')
|
289
|
-
update_task
|
292
|
+
update_task(item, :list, lambda do |task|
|
290
293
|
task[:due] = convert_due_date(date)
|
291
294
|
task.delete(:due) if task[:due].nil?
|
292
|
-
|
295
|
+
end)
|
293
296
|
end
|
294
297
|
|
295
298
|
def list(tasks = nil, patterns = nil)
|
@@ -326,16 +329,16 @@ class Todo
|
|
326
329
|
end
|
327
330
|
|
328
331
|
def add_note(item, text)
|
329
|
-
update_task
|
332
|
+
update_task(item, :show, lambda do |task|
|
330
333
|
task[:note] ||= []
|
331
334
|
task[:note].push(text)
|
332
|
-
|
335
|
+
end)
|
333
336
|
end
|
334
337
|
|
335
338
|
def delete_note(item)
|
336
|
-
update_task
|
339
|
+
update_task(item, :show, lambda do |task|
|
337
340
|
task.delete(:note)
|
338
|
-
|
341
|
+
end)
|
339
342
|
end
|
340
343
|
|
341
344
|
def show(item, tasks = nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: todo-jsonl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabor Bata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|