rbbt-util 5.32.23 → 5.32.24

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
  SHA256:
3
- metadata.gz: 900a7061d40ec2cbffd38886ef9629aa0c0ed6d6ee1aef6e0c95c51656230ef0
4
- data.tar.gz: 13b965a0ec134a932c6ae0ae6a109fbc2bc83b7ffd855a1ef05ed4e1e51b9d88
3
+ metadata.gz: 7a7eebab331a8908a290e4a3ad8db2ee3dc3c3dec07b93ec1c74f504f9f7ea29
4
+ data.tar.gz: 0f9a2ce6019676118ab439dea57f16605555d9ef850c35998704b9215c477ffb
5
5
  SHA512:
6
- metadata.gz: 3b890e2b6fb3675df4319d0541d9057a54b0cb37286a814822915f5b5b061d4f7e02deab0afdd7cd0833cb741aeded7454a9585f93ff3486e595b99db4da00f6
7
- data.tar.gz: 105072ca6c7b5c43c6a60455eaa9c7167feeb93f505c61c6aeffe6305de3166a6cb440c262abf025407306ba82c2fe3167f5f9e743e086d99fa936e44ea8e448
6
+ metadata.gz: 2d81532c2babaae631ca98784e7b7e36039fed68544b6bce9fc8fc2d74a155ffd98fe0752477c7ad245aaa0c65e82c47f330f65c5d70a7f5f20a77de4bc4dbd6
7
+ data.tar.gz: 2914786ec23349cabccbb6e8a1c561336b60dd5d862e89c3a95802f040c66f8107d5a2135455f00d8bc7b9e06e390fd6462a861419b78ae25bf3a58c14a33350
data/bin/rbbt CHANGED
@@ -262,9 +262,8 @@ rescue ParameterException
262
262
  puts
263
263
  exit_status = -1
264
264
  exit exit_status
265
- rescue SystemExit
266
- rescue CmdStop
267
- exit_status = $!.exit_status
265
+ rescue SystemExit,CmdStop
266
+ exit_status = $!.status
268
267
  exit exit_status
269
268
  rescue Exception
270
269
  Log.exception $!
@@ -356,6 +356,16 @@ module TSV
356
356
  elems.sort_by{|k,v| v}.collect{|k,v| k}
357
357
  end
358
358
 
359
+ def subset(keys)
360
+ new = TSV.setup({}, :key_field => key_field, :fields => fields, :type => type, :filename => filename, :identifiers => identifiers)
361
+ self.with_unnamed do
362
+ keys.each do |k|
363
+ new[k] = self[k]
364
+ end
365
+ end
366
+ new
367
+ end
368
+
359
369
  def select(method = nil, invert = false, &block)
360
370
  new = TSV.setup({}, :key_field => key_field, :fields => fields, :type => type, :filename => filename, :identifiers => identifiers)
361
371
 
@@ -48,7 +48,7 @@ module Workflow
48
48
 
49
49
 
50
50
  case input_types[input]
51
- when :file
51
+ when :file, :binary
52
52
  Log.debug "Pointing #{ input } to #{file}"
53
53
  if file =~ /\.yaml/
54
54
  inputs[input.to_sym] = YAML.load(Open.read(file))
data/lib/rbbt/workflow.rb CHANGED
@@ -45,14 +45,10 @@ module Workflow
45
45
  load_remote_tasks(Rbbt.root.etc.remote_tasks.find) if Rbbt.root.etc.remote_tasks.exists?
46
46
  end
47
47
 
48
- def self.require_remote_workflow(wf_name, url)
49
- require 'rbbt/workflow/remote_workflow'
50
- eval "Object::#{wf_name} = RemoteWorkflow.new '#{ url }', '#{wf_name}'"
51
- end
52
48
 
53
49
  def self.require_remote_workflow(wf_name, url)
54
50
  require 'rbbt/workflow/remote_workflow'
55
- eval "Object::#{wf_name} = RemoteWorkflow.new '#{ url }', '#{wf_name}'"
51
+ eval "Object::#{wf_name.split("+").first} = RemoteWorkflow.new '#{ url }', '#{wf_name}'"
56
52
  end
57
53
 
58
54
  def self.load_workflow_libdir(filename)
@@ -134,9 +130,10 @@ module Workflow
134
130
  end
135
131
 
136
132
  def self.require_local_workflow(wf_name)
133
+
137
134
  filename = local_workflow_filename(wf_name)
138
135
 
139
- if filename and File.exist? filename
136
+ if filename and File.exist?(filename)
140
137
  load_workflow_file filename
141
138
  else
142
139
  return false
@@ -194,14 +191,23 @@ module Workflow
194
191
  end
195
192
 
196
193
  Log.high{"Loading workflow #{wf_name}"}
197
- require_local_workflow(wf_name) or
198
- (Workflow.autoinstall and `rbbt workflow install #{Misc.snake_case(wf_name)} || rbbt workflow install #{wf_name}` and require_local_workflow(wf_name)) or raise("Workflow not found or could not be loaded: #{ wf_name }")
199
- workflow = begin
200
- Misc.string2const Misc.camel_case(wf_name)
201
- rescue
202
- Workflow.workflows.last || true
203
- end
204
- workflow.load_documentation
194
+
195
+ first = nil
196
+ wf_name.split("+").each do |wf_name|
197
+ require_local_workflow(wf_name) or
198
+ (Workflow.autoinstall and `rbbt workflow install #{Misc.snake_case(wf_name)} || rbbt workflow install #{wf_name}` and require_local_workflow(wf_name)) or raise("Workflow not found or could not be loaded: #{ wf_name }")
199
+
200
+ workflow = begin
201
+ Misc.string2const Misc.camel_case(wf_name.split("+").first)
202
+ rescue
203
+ Workflow.workflows.last || true
204
+ end
205
+ workflow.load_documentation
206
+
207
+ first ||= workflow
208
+ end
209
+ return first
210
+
205
211
  workflow
206
212
  end
207
213
 
@@ -287,8 +287,8 @@ else
287
287
  puts
288
288
  puts $!.message
289
289
  puts
290
-
291
- exit 0
290
+
291
+ exit -1
292
292
  end
293
293
  end
294
294
 
@@ -572,7 +572,9 @@ when Step
572
572
  exit! 0
573
573
  else
574
574
  res.join
575
- out.puts Open.read(res.path) if Open.exist?(res.path) || Open.remote?(res.path) || Open.ssh?(res.path)
575
+ Open.open(res.path, :mode => 'rb') do |io|
576
+ Misc.consume_stream(io, false, out)
577
+ end if Open.exist?(res.path) || Open.remote?(res.path) || Open.ssh?(res.path)
576
578
  end
577
579
  else
578
580
  if Array === res
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.32.23
4
+ version: 5.32.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-28 00:00:00.000000000 Z
11
+ date: 2021-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake