task_manager2 0.0.11 → 0.0.12

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: 86c20c23a3e15f96e9f594523db88d7bc1e2d19f
4
- data.tar.gz: 9f5ddc0031b83fced6a5f7a9825a18dd8a37beca
3
+ metadata.gz: bf0cde7e80abc1c085f5d713e5292f87f138a68c
4
+ data.tar.gz: 93932d2c77ef84f469d88d7eecba964daf2be258
5
5
  SHA512:
6
- metadata.gz: d020635c7ed9891eb300b93c5701a3303315471b462417a2f4b2b851a8743067a1b7c8bdd92c4e078a3b7fd8ec0e76a8b6d0a970956ddf6fdba2a201700407eb
7
- data.tar.gz: 21dd8e7998e1dc365eec2ca27745de639e6317412322b8608559feb8d2548f633d4b73a45302a8e2b27da87a44ab6ab00ff0ac2746762db6e6793bd22e966862
6
+ metadata.gz: 5fe732dfa434397058d9286627affad2853454160185e686510b59bf731e2269e1604076a671f7e6a8e0628ad63e3df373ddc84ab1d16e5b47abfaa61497d903
7
+ data.tar.gz: 73e2faadb9f403bc93f97f2da33a780685ade2d86e91d050b488fe3ed0519bb2b0fb8b1d4bb918d8b2e6dea5a43d0c855ac3edbe26107f77483256763bf8cb07
@@ -4,6 +4,7 @@ module TaskManager
4
4
  node = root_node.css('task').find { |t| t['id'].to_i == id.to_i }
5
5
  raise 'ID not exists'.colorize(:light_red) unless node
6
6
  task = Task.new_from_node(node)
7
+ yield(task) if block_given?
7
8
  handle_xml { node.remove }
8
9
  task
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module TaskManager
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
data/lib/task_manager.rb CHANGED
@@ -21,10 +21,13 @@ module TaskManager
21
21
  end
22
22
 
23
23
  def self.pick(id)
24
- task = NewTaskFile.new.pick(id)
25
- CurrentTaskFile.new.add(task)
24
+ task = NewTaskFile.new.pick(id) do |task|
25
+ CurrentTaskFile.new.add(task)
26
+ end
26
27
  print('Picked task:'.colorize(:light_cyan))
27
28
  print_task(task)
29
+ rescue Exception => e
30
+ print e.message
28
31
  end
29
32
 
30
33
  def self.current
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.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duc Le