task_manager2 0.0.5 → 0.0.6

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: d1da289db61468f8efba504969fd2538df3242b2
4
- data.tar.gz: e4fd700a014f84c64873c902cc2b367893a40e58
3
+ metadata.gz: 5ba84945c4b897357274df70805bdb90890af854
4
+ data.tar.gz: 6f12aa8db190ee1cd52d7553128dbe8556d08e0f
5
5
  SHA512:
6
- metadata.gz: f9665cec52564354ee56fdf83634403c59d0b6271a83555966c9f1b65999eecadcb844d959427c6022107663feed2e54afcac8601e2b58e88c8daab40d2f2849
7
- data.tar.gz: 16346686f2a120a36373b636985ba0a8fb9e01d70fe6f8c5a03ff0400f40050abf670a25f0c69cc3677c4c9cbc6c0450b21128ed5281cf5eb176c36819b70d42
6
+ metadata.gz: daf747446aa44dcde97027f84752ed281483da00125f979352f93d8fb96cdd7c27020d628e6c69a3bfde82ec507dde2be873f1230302591ebc8e5aba66f45a73
7
+ data.tar.gz: 9bd3a005004c60e297f12d8d55019b5eb130908adb33f823d742df05cc3a8ad00c43d14804a31d2c6f54870d9bfea487f8abd9d29d5facf317ecd0618d2a2d04
@@ -6,13 +6,13 @@ module TaskManager
6
6
 
7
7
  desc 'add', 'Add a new task to the waiting queue'
8
8
  method_option :name, aliases: '-n', desc: 'Name of the task', type: :string, required: true
9
- method_option :score, aliases: '-s', desc: 'Score of the task', type: :integer
9
+ method_option :score, aliases: '-s', desc: 'Score of the task', type: :numeric
10
10
  def add
11
11
  TaskManager.add(options[:name], options[:score])
12
12
  end
13
13
 
14
14
  desc 'pick', 'Pick a task from the waiting queue'
15
- method_option :id, aliases: '-i', desc: 'ID of the task', type: :integer, required: true
15
+ method_option :id, aliases: '-i', desc: 'ID of the task', type: :numeric, required: true
16
16
  def pick
17
17
  TaskManager.pick(options[:id])
18
18
  end
@@ -1,5 +1,10 @@
1
1
  module TaskManager
2
2
  class CurrentTaskFile < TaskFile
3
+ def add(task)
4
+ raise "You haven't finished the current task".colorize(:light_red)
5
+ super
6
+ end
7
+
3
8
  def current
4
9
  Task.new_from_node(current_node)
5
10
  end
@@ -2,6 +2,7 @@ module TaskManager
2
2
  class NewTaskFile < TaskFile
3
3
  def pick(id)
4
4
  node = root_node.css('task').find { |t| t['id'].to_i == id }
5
+ raise 'ID not exists'.colorize(:light_red)
5
6
  task = Task.new_from_node(node)
6
7
  handle_xml { node.remove }
7
8
  task
@@ -1,3 +1,3 @@
1
1
  module TaskManager
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - MatBi