rbbt-util 5.8.9 → 5.8.10

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: 35fd0fde3df8674639985a5bbabd89e0a83058ee
4
- data.tar.gz: dc3c48e82d9f04bedf08f44e9464808f5391b431
3
+ metadata.gz: 985a049f7bd611901dc77ac6fbb9f8529f9ed01c
4
+ data.tar.gz: 653082e1984c57a177161f0e1f23e1a2c1f1506c
5
5
  SHA512:
6
- metadata.gz: 03400322b9a7c297733595da6383d92bdd8da7885e606ab4fdfd2676d92889d6be8a2143b8116962ab99d9e8d877644d7dedf58abd635e39c4de1619c69b661a
7
- data.tar.gz: ab8493c97a47c7e075c0db9556c1d1c62b46d0801beabf033c27e9f58d9e9c342b2fc831f22d7fdbef0a08f04c145a8be7badc39108eb159b91fe10b8fc39098
6
+ metadata.gz: d1ecb5c1fb2a9880b52003a0c20e137fc627ab9ed685dab911ce2f4c84e32bce7fbfad4c9abbb1c245872c325e2d388373ca4abc9e4167ed2887a9e8ed3d14a2
7
+ data.tar.gz: 5e40f5ac11b3bbb015eb30742770821f6d434442b95aeb62c5afe8eccec0aec6d02601e317e2737d8b1eea0f5c66cc27f0b22df1ec31ee092a3215edb185a0aa
data/lib/rbbt/workflow.rb CHANGED
@@ -6,6 +6,16 @@ require 'rbbt/workflow/doc'
6
6
 
7
7
  module Workflow
8
8
 
9
+ class TaskNotFoundException < Exception
10
+ def initialize(workflow, task = nil)
11
+ if task
12
+ super "Task '#{ task }' not found in #{ workflow } workflow"
13
+ else
14
+ super workflow
15
+ end
16
+ end
17
+ end
18
+
9
19
  #{{{ WORKFLOW MANAGEMENT
10
20
  class << self
11
21
  attr_accessor :workflows, :autoinstall
@@ -12,7 +12,7 @@ require 'rbbt/rest/workflow'
12
12
  require 'rbbt/rest/file_server'
13
13
  require 'rbbt/rest/helpers'
14
14
 
15
- options = SOPT.get "-e--environment*:-p--port*:-s--server*:-b--bind*"
15
+ options = SOPT.get "-e--environment*:-p--port*:-s--server*:-b--bind*:-e--environment*"
16
16
 
17
17
  workflow = ARGV.first
18
18
 
@@ -64,6 +64,6 @@ WorkflowRest.add_workflow Workflow.workflows.last, true
64
64
 
65
65
  WorkflowRest.port = options[:port] || 4567
66
66
  WorkflowRest.bind = options[:bind] || "0.0.0.0"
67
- WorkflowRest.environment = options[:environment] || "0.0.0.0"
67
+ WorkflowRest.environment = options[:environment] || "development"
68
68
  WorkflowRest.server = options[:server] if options[:server]
69
69
  WorkflowRest.run!
@@ -210,14 +210,22 @@ namespace = nil, nil
210
210
  case
211
211
  when task.nil?
212
212
  usage workflow and exit 0
213
- # Can not remember what this was
214
- #when (task =~ /\./)
215
- # namespace, task = options.delete(:task).split('.')
216
- # namespace = Misc.string2const(namespace)
217
213
  else
218
214
  task_name = task.to_sym
219
- task = workflow.tasks[task_name]
220
- raise ParameterException, "Task not found: #{ task_name }" if task.nil?
215
+ begin
216
+ task = workflow.tasks[task_name]
217
+ raise Workflow::TaskNotFoundException.new workflow, task_name if task.nil?
218
+ rescue Workflow::TaskNotFoundException
219
+ usage workflow
220
+
221
+ puts
222
+ puts Log.color :red, "Error:"
223
+ puts
224
+ puts $!.message
225
+ puts
226
+
227
+ exit 0
228
+ end
221
229
  end
222
230
 
223
231
  usage workflow, task and exit 0 if help
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.8.9
4
+ version: 5.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez