todo-jsonl 0.1.6 → 0.1.7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/todo.rb +19 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bfdc7f1aa08b2e153cb2db14f20487511c3dd4064b5f11164d5f6f503b65ba2
4
- data.tar.gz: 6cc8401c245972537c76589ed4cab56b712006216bf1a442269ccb5aa2961cf0
3
+ metadata.gz: 7aab10deef9e956db5b18eaed5938749e225e3fdb99764c119fabe7bfa16969f
4
+ data.tar.gz: 682cf59b330c12e2276e350dba4112e34a56edbf0274276eabb12be81c3b406d
5
5
  SHA512:
6
- metadata.gz: 434b78f9f7f72bfbf127d57e24ab1a48558495e2f79a807554ddfe49197ea20174c68e09ea705215a222ac1acfbcc5114a719dfc301aa96f4f6a5969848c88f4
7
- data.tar.gz: 99a3bf80d303e66da13b92a6fa95ec5a31db4623f2fbe9a28f8a7b2b623e858312b397777cb6d297fe2b8e7f96e9f218a961bf6c5606194240c1aa26ec568c08
6
+ metadata.gz: 9f4e3193f34df98c4cc50b86722246724cb31dd3d54d754435db5d80a0ac0300a026d5e09c479061a1f8fd65f40773dff5d175184078c573c1d102344a5dd7f7
7
+ data.tar.gz: 824d0796aa292733ef672d2998377975b3b55a43021224213fa9b78af52fb3dc96842db1d7c00dfe727d6ea593d2bfb694e4072234932d5aff1a53919d48a615
@@ -95,7 +95,7 @@ def usage
95
95
  * block <tasknumber> mark task as blocked
96
96
  * reset <tasknumber> reset task to new state
97
97
  * prio <tasknumber> toggle high priority flag
98
- * due <tasknumber> <date> set due date
98
+ * due <tasknumber> <date> set due date (in YYYY-MM-DD format)
99
99
 
100
100
  * append <tasknumber> <text> append text to task title
101
101
  * rename <tasknumber> <text> rename task
@@ -287,7 +287,8 @@ def read(arguments)
287
287
  args = arguments[1..-1] || []
288
288
  case action
289
289
  when 'add'
290
- add(args.join(' ')) unless args.nil? || args.empty?
290
+ raise action + ' command requires at least one parameter' if args.nil? || args.empty?
291
+ add(args.join(' '))
291
292
  when 'start'
292
293
  args.length == 1 ? change_state(args.first.to_i, 'started') : list(nil, [':started'])
293
294
  when 'done'
@@ -297,23 +298,31 @@ def read(arguments)
297
298
  when 'reset'
298
299
  args.length == 1 ? change_state(args.first.to_i, 'new') : list(nil, [':new'])
299
300
  when 'prio'
300
- set_priority(args.first.to_i) if args.length == 1
301
+ raise action + ' command requires exactly one parameter' if args.length != 1
302
+ set_priority(args.first.to_i)
301
303
  when 'due'
302
- due_date(args.first.to_i, (args[1..-1] || []).join(' ')) unless args.length < 1
304
+ raise action + ' command requires at least one parameter' if args.length < 1
305
+ due_date(args.first.to_i, (args[1..-1] || []).join(' '))
303
306
  when 'append'
304
- append(args.first.to_i, args[1..-1].join(' ')) unless args.length < 2
307
+ raise action + ' command requires at least two parameters' if args.length < 2
308
+ append(args.first.to_i, args[1..-1].join(' '))
305
309
  when 'rename'
306
- rename(args.first.to_i, args[1..-1].join(' ')) unless args.length < 2
310
+ raise action + ' command requires at least two parameters' if args.length < 2
311
+ rename(args.first.to_i, args[1..-1].join(' '))
307
312
  when 'del'
308
- delete(args.first.to_i) if args.length == 1
313
+ raise action + ' command requires exactly one parameter' if args.length != 1
314
+ delete(args.first.to_i)
309
315
  when 'note'
310
- add_note(args.first.to_i, args[1..-1].join(' ')) unless args.length < 2
316
+ raise action + ' command requires at least two parameters' if args.length < 2
317
+ add_note(args.first.to_i, args[1..-1].join(' '))
311
318
  when 'delnote'
312
- delete_note(args.first.to_i) if args.length == 1
319
+ raise action + ' command requires exactly one parameter' if args.length != 1
320
+ delete_note(args.first.to_i)
313
321
  when 'list'
314
322
  list(nil, args)
315
323
  when 'show'
316
- show(args.first.to_i) if args.length == 1
324
+ raise action + ' command requires exactly one parameter' if args.length != 1
325
+ show(args.first.to_i)
317
326
  when 'help'
318
327
  puts usage
319
328
  when 'repl'
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabor Bata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-04 00:00:00.000000000 Z
11
+ date: 2020-10-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: