todo-jsonl 1.0.4 → 1.0.5
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 +11 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b0c251bf65b4b67f7e2650f10b6e898047a8dc1b5fcd89f1ebc364b27334f07
|
4
|
+
data.tar.gz: 86d3647f960571d3a7b5c9f33c55352a2852c6c193696eee090aeb93854009f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e6a0153c341b7e2f7593cc2cd651e26493ea885718392d237f609c3f7b4035d538a2db20b5ba89b56639d14fafb06e7d225bcb417edf5fd5918e26574122174
|
7
|
+
data.tar.gz: 47daf98ef96b84241eeca49cbecd2ff33a4ad53663fdcbfaeba1377cabfb504b1273c71a90a462396bcec74e44f2deb4e2f37490bc1ae1a559e889f615946b61
|
data/bin/todo.rb
CHANGED
@@ -324,7 +324,7 @@ class Todo
|
|
324
324
|
end
|
325
325
|
due_date = ' ' + due_date
|
326
326
|
end
|
327
|
-
puts "#{num.to_s.rjust(task_indent
|
327
|
+
puts "#{num.to_s.rjust(task_indent)}:#{priority_flag}#{display_state} #{title}#{due_date}"
|
328
328
|
end
|
329
329
|
puts 'No todos found' if items.empty?
|
330
330
|
end
|
@@ -338,19 +338,23 @@ class Todo
|
|
338
338
|
|
339
339
|
def delete_note(item, num = nil)
|
340
340
|
update_task(item, :show, lambda do |task|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
341
|
+
if num.to_s.empty?
|
342
|
+
task.delete(:note)
|
343
|
+
else
|
344
|
+
raise "#{num.to_i}: Note does not exist" if num.to_i <= 0 || task[:note].to_a.size < num.to_i
|
345
|
+
task[:note].delete_at(num.to_i - 1)
|
346
|
+
task.delete(:note) if task[:note].empty?
|
347
|
+
end
|
345
348
|
end)
|
346
349
|
end
|
347
350
|
|
348
351
|
def show(item, tasks = nil)
|
349
352
|
tasks ||= load_tasks(item)
|
350
353
|
tasks[item].each do |k, v|
|
351
|
-
v = "\n" + v.each_with_index.
|
354
|
+
v = "\n" + v.each_with_index.
|
355
|
+
map { |n, i| v.size > 1 ? "#{(i + 1).to_s.rjust(v.size.to_s.size)}: #{n}" : n }.
|
352
356
|
join("\n") if v.is_a?(Array)
|
353
|
-
puts "#{colorize(k.to_s.rjust(10
|
357
|
+
puts "#{colorize(k.to_s.rjust(10) + ':', :cyan)} #{v}"
|
354
358
|
end
|
355
359
|
end
|
356
360
|
|