task_manager2 0.0.15 → 0.0.16

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: 5a34fcd1a6076adc9f4b790cf29467cb74b5b9f5
4
- data.tar.gz: 8bfa137c88d868842831d1c6e46d09107d45dff6
3
+ metadata.gz: ec0909a32e269d9fa5309e57298158f91552c741
4
+ data.tar.gz: 6946ec35bc3779ae9bab6a7c928fdaab3b236ce1
5
5
  SHA512:
6
- metadata.gz: d7c0539879a68527a1a554393973816d615b7e962718d1e3d1af1779f543da3697fc389661b9a35dde5b0b559b56bbbb2b5e980e840d916a1a7f172feb7e207a
7
- data.tar.gz: d32b8a9ebd584d663221103e62565a43688fdc7eb21f1b8d9dbfd525e55a442f9210a92369f1ec6528c2a5980777afdbc61e12cfbaf303464d59c849d7c6735d
6
+ metadata.gz: b3b50b26c870c321ea482ed09f701aad32cd32a84ca898da7621e160738f40d98beeda0145ba24c561ab831828d611b282c61d2081745a5f90bd054f95b52074
7
+ data.tar.gz: 4cb7bc505d0711088680d070f0063b4985e4a9bf2e9bde114bd26d88d9946a2325e6111de4644f5eed7dcfa89f81cc0d607e9ecfac036daca15cac549c02f26b
@@ -17,6 +17,11 @@ module TaskManager
17
17
  TaskManager.pick(options[:id])
18
18
  end
19
19
 
20
+ desc 'undo', 'Undo the current task, put it back to the waiting queue'
21
+ def undo
22
+ TaskManager.undo
23
+ end
24
+
20
25
  desc 'delete', 'Delete a task from the waiting queue'
21
26
  method_option :id, aliases: '-i', desc: 'ID of the task', type: :numeric, required: true
22
27
  def delete
@@ -1,3 +1,3 @@
1
1
  module TaskManager
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
data/lib/task_manager.rb CHANGED
@@ -30,6 +30,15 @@ module TaskManager
30
30
  print e.message
31
31
  end
32
32
 
33
+ def self.undo
34
+ task = CurrentTaskFile.new.pick
35
+ NewTaskFile.new.add(task)
36
+ print('Undid task:'.colorize(:light_cyan))
37
+ print_task(task)
38
+ rescue Exception => e
39
+ print e.message
40
+ end
41
+
33
42
  def self.delete(id)
34
43
  task = NewTaskFile.new.delete(id)
35
44
  print('Deleted task:'.colorize(:light_cyan))
@@ -51,6 +60,8 @@ module TaskManager
51
60
  DoneTaskFile.new.add(task)
52
61
  print('Finished task:'.colorize(:light_green))
53
62
  print_task(task)
63
+ rescue Exception => e
64
+ print e.message
54
65
  end
55
66
 
56
67
  def self.finish_with_id(id)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: task_manager2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duc Le