task_manager2 0.0.14 → 0.0.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e1432d08f8e70af30d814d1248d3d105df18f32
4
- data.tar.gz: b0b9a2827b57e6cf23294ade612f4eba75cac7d2
3
+ metadata.gz: 5a34fcd1a6076adc9f4b790cf29467cb74b5b9f5
4
+ data.tar.gz: 8bfa137c88d868842831d1c6e46d09107d45dff6
5
5
  SHA512:
6
- metadata.gz: 38d05bf3c2003559ec018dc1c942c99bdb0dd0df8384a0852105d7c4766b05a8030deae769782ca28ca59cfcdf1c39f1bf0f11748709e85dae36f611e4047248
7
- data.tar.gz: 2439808f9fd80cb3cf9c0a9f65242bd6849bd2a04a688857946843939015225806e73122c55b71fb9d21a26dea0e3ccdfecc84bd3ca83a3c9daa35a08d991d0e
6
+ metadata.gz: d7c0539879a68527a1a554393973816d615b7e962718d1e3d1af1779f543da3697fc389661b9a35dde5b0b559b56bbbb2b5e980e840d916a1a7f172feb7e207a
7
+ data.tar.gz: d32b8a9ebd584d663221103e62565a43688fdc7eb21f1b8d9dbfd525e55a442f9210a92369f1ec6528c2a5980777afdbc61e12cfbaf303464d59c849d7c6735d
data/lib/task_manager.rb CHANGED
@@ -53,6 +53,16 @@ module TaskManager
53
53
  print_task(task)
54
54
  end
55
55
 
56
+ def self.finish_with_id(id)
57
+ task = NewTaskFile.new.pick(id) do |task|
58
+ DoneTaskFile.new.add(task)
59
+ end
60
+ print('Finished task:'.colorize(:light_green))
61
+ print_task(task)
62
+ rescue Exception => e
63
+ print e.message
64
+ end
65
+
56
66
  def self.stats
57
67
  print('Waiting tasks:'.colorize(:light_cyan))
58
68
  NewTaskFile.new.all.each do |task|
@@ -28,9 +28,14 @@ module TaskManager
28
28
  TaskManager.current
29
29
  end
30
30
 
31
- desc 'finish', 'Finish the current task'
31
+ desc 'finish', 'Finish the current task or finish the task with ID in the waiting queue'
32
+ method_option :id, aliases: '-i', desc: 'ID of the task', type: :numeric
32
33
  def finish
33
- TaskManager.finish
34
+ if options[:id]
35
+ TaskManager.finish_with_id(options[:id])
36
+ else
37
+ TaskManager.finish
38
+ end
34
39
  end
35
40
 
36
41
  desc 'stats', 'Statistics of all queues'
@@ -1,3 +1,3 @@
1
1
  module TaskManager
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: task_manager2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duc Le
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-18 00:00:00.000000000 Z
11
+ date: 2016-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -148,3 +148,4 @@ signing_key:
148
148
  specification_version: 4
149
149
  summary: A simple task manager in console
150
150
  test_files: []
151
+ has_rdoc: