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 +4 -4
- data/lib/task_manager/cli.rb +5 -0
- data/lib/task_manager/version.rb +1 -1
- data/lib/task_manager.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec0909a32e269d9fa5309e57298158f91552c741
|
4
|
+
data.tar.gz: 6946ec35bc3779ae9bab6a7c928fdaab3b236ce1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3b50b26c870c321ea482ed09f701aad32cd32a84ca898da7621e160738f40d98beeda0145ba24c561ab831828d611b282c61d2081745a5f90bd054f95b52074
|
7
|
+
data.tar.gz: 4cb7bc505d0711088680d070f0063b4985e4a9bf2e9bde114bd26d88d9946a2325e6111de4644f5eed7dcfa89f81cc0d607e9ecfac036daca15cac549c02f26b
|
data/lib/task_manager/cli.rb
CHANGED
@@ -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
|
data/lib/task_manager/version.rb
CHANGED
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)
|