todo-jsonl 1.0.6 → 1.0.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 +10 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a12de5f4f64f3d33b1168b0c39dc69335435ce4229dea4855c46aa70ccc7b0a3
4
- data.tar.gz: '018b97ef5b26f06143955d7cef8cdfd92c8dec7932b64a20721636e4a1800f8d'
3
+ metadata.gz: 3e5df379407838c3c11f109e146fdddcb560fffdfc30ed29885913b8362ae565
4
+ data.tar.gz: 4dafcccddbc47174db8dfa37c09e508a10943e5b94ef339784a1e4097dd0443e
5
5
  SHA512:
6
- metadata.gz: acc30afd6f1d97e6f3752ec1b0350a73c61c350490836d85c5aa308312f2337ecfb0391ed43d90fec7953e4611af27b7e90559f57cd8fc078b65a924a55fb473
7
- data.tar.gz: 834d2ff05757b86babd4a8b640f37b0516a54d6f76941aaaad9cbab525c3c33c0b6080eb9caf432a04b959a33344e3c51b45db2272203ed0898bf446e5bea453
6
+ metadata.gz: 936dcca49f95ba126bb7b072f09ae4f3e6e05bfc31635b9d7acdee7b7393c5495e2e1f9ccb5cbab0a52d31509b3b94016cfbf102aad1e6ceaea292a890b2c777
7
+ data.tar.gz: d4c0ca6ed381cd2a38f40c88a3c451b45851c35dfeebe4afde82be5022c17d5b45d5e43c954c52418324df38bf319d4719bbe214b039521aa6b8fca6d742712d
data/bin/todo.rb CHANGED
@@ -75,37 +75,37 @@ class Todo
75
75
  begin
76
76
  setup
77
77
  action = arguments.first
78
- args = arguments[1..-1] || []
78
+ args = arguments.drop(1)
79
79
  case action
80
80
  when 'add'
81
81
  raise action + ' command requires at least one parameter' if args.nil? || args.empty?
82
82
  add(args.join(' '))
83
83
  when 'start'
84
- args.length > 0 ? change_state(args.first.to_i, 'started', (args[1..-1] || []).join(' ')) : list(nil, [':started'])
84
+ args.length > 0 ? change_state(args.first.to_i, 'started', args.drop(1).join(' ')) : list(nil, [':started'])
85
85
  when 'done'
86
- args.length > 0 ? change_state(args.first.to_i, 'done', (args[1..-1] || []).join(' ')) : list(nil, [':done'])
86
+ args.length > 0 ? change_state(args.first.to_i, 'done', args.drop(1).join(' ')) : list(nil, [':done'])
87
87
  when 'block'
88
- args.length > 0 ? change_state(args.first.to_i, 'blocked', (args[1..-1] || []).join(' ')) : list(nil, [':blocked'])
88
+ args.length > 0 ? change_state(args.first.to_i, 'blocked', args.drop(1).join(' ')) : list(nil, [':blocked'])
89
89
  when 'reset'
90
- args.length > 0 ? change_state(args.first.to_i, 'new', (args[1..-1] || []).join(' ')) : list(nil, [':new'])
90
+ args.length > 0 ? change_state(args.first.to_i, 'new', args.drop(1).join(' ')) : list(nil, [':new'])
91
91
  when 'prio'
92
92
  raise action + ' command requires at least one parameter' if args.length < 1
93
- set_priority(args.first.to_i, (args[1..-1] || []).join(' '))
93
+ set_priority(args.first.to_i, args.drop(1).join(' '))
94
94
  when 'due'
95
95
  raise action + ' command requires at least one parameter' if args.length < 1
96
- due_date(args.first.to_i, (args[1..-1] || []).join(' '))
96
+ due_date(args.first.to_i, args.drop(1).join(' '))
97
97
  when 'append'
98
98
  raise action + ' command requires at least two parameters' if args.length < 2
99
- append(args.first.to_i, args[1..-1].join(' '))
99
+ append(args.first.to_i, args.drop(1).join(' '))
100
100
  when 'rename'
101
101
  raise action + ' command requires at least two parameters' if args.length < 2
102
- rename(args.first.to_i, args[1..-1].join(' '))
102
+ rename(args.first.to_i, args.drop(1).join(' '))
103
103
  when 'del'
104
104
  raise action + ' command requires exactly one parameter' if args.length != 1
105
105
  delete(args.first.to_i)
106
106
  when 'note'
107
107
  raise action + ' command requires at least two parameters' if args.length < 2
108
- add_note(args.first.to_i, args[1..-1].join(' '))
108
+ add_note(args.first.to_i, args.drop(1).join(' '))
109
109
  when 'delnote'
110
110
  raise action + ' command requires one or two parameters' if args.length < 1 || args.length > 2
111
111
  delete_note(args.first.to_i, args[1])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: todo-jsonl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabor Bata