ruboty-todo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11e041e3f81d6c74311f8482d848194ad809e43c
4
- data.tar.gz: 1048df7f4eff0efb516612fe0b06314b8ec0502e
3
+ metadata.gz: 401490d5fdc8aa818f937bc9d1e47f82e53626ad
4
+ data.tar.gz: bc865809d9e882f27380ecfc1c0c742975f045e2
5
5
  SHA512:
6
- metadata.gz: b42810785dda4143fe8559eac444843bcc2888620d58c42d1f39e960fd6892c01af207ff0b2fcc7746eac2dcf18c9465bcd7f19b0e492a894772069e180d41c9
7
- data.tar.gz: f5eb99b325263feded2a39d0c2727150315a637be6d89fa03537ed8e2683a7813fc060d49c3b5bf60a11653f5801c3ddb95fc0da36a7f95ddb588f811df76c3f
6
+ metadata.gz: dccb9e91402f3f0953c33a2f7200f0997cdd9a3b04c07fe167944d625312649a58c36249da5dfd1fcd2a1fa4f9c1d6decc31bb1efe5dbf4612fd44ccbb39cad4
7
+ data.tar.gz: b82452f44932d45a322e177238735ee13fd4f65119f7bab85e9c75d881c17db73f52d8311bd32cfaa303e5de51aaca99ef0f3867c0d7f00d08cc404f0d5dca1d
@@ -23,7 +23,7 @@ module Ruboty
23
23
  show todo list
24
24
  `todo add [TITLE]`
25
25
  add list to new todo
26
- `todo start [ID}`
26
+ `todo start [ID]`
27
27
  start todo
28
28
  `todo finish [ID]`
29
29
  finish todo (will removed by `cleanup`)
@@ -39,7 +39,8 @@ EOH
39
39
  end
40
40
 
41
41
  def add(arg)
42
- return 'specify todo tilte like `todo add [TITLE]`' if title == ''
42
+ title = arg.to_s.strip
43
+ return 'specify todo title like `todo add [TITLE]`' if title == ''
43
44
  todo_list.add(title: title).format(new_item: true)
44
45
  end
45
46
 
@@ -21,7 +21,9 @@ module Ruboty
21
21
  end
22
22
 
23
23
  def cleanup
24
- list[:items] = list[:items].reject { |item| item.deleted? }
24
+ list[:items] = list[:items].reject { |item| item.deleted? || item.done? }
25
+ reset_id if list[:items].empty?
26
+ items
25
27
  end
26
28
 
27
29
  def find(id)
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Todo
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-todo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SHIOYA, Hiromu