rbbt-util 5.33.20 → 5.33.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/util/misc/pipes.rb +9 -1
- data/lib/rbbt/util/open.rb +1 -0
- data/lib/rbbt/workflow.rb +1 -1
- data/share/rbbt_commands/hpc/list +1 -1
- data/share/rbbt_commands/lsf/list +1 -1
- data/share/rbbt_commands/slurm/list +1 -1
- data/share/rbbt_commands/workflow/task +1 -1
- data/test/rbbt/util/misc/test_pipes.rb +37 -0
- data/test/rbbt/util/test_open.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 563841b942e1b0cf4a97bed6900bd51c96df63ec993d3a5280faadbf7b8eb753
|
4
|
+
data.tar.gz: c2cd78f5dfe5061f97021fd2121dd415d7b6c36c1fef2fc9f496c2cc985e4c4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6382e73cdb35ff7ab7dcd3de894a192353c39edef06ddaeb030ec376089b638acb0f62f468153433dfb0e3b0242a44146bfaeb1770ef35ee7175200caeea5e12
|
7
|
+
data.tar.gz: '08b8ce8d556f25269c671b6307972669927b468975c77d188b572e2285627968989a2db68de7fa2983908cb7d4cf3a236f0908a78d3917ea46ad84f82c60f536'
|
data/lib/rbbt/util/misc/pipes.rb
CHANGED
@@ -92,7 +92,6 @@ module Misc
|
|
92
92
|
ConcurrentStream.setup sout, :pids => [pid]
|
93
93
|
else
|
94
94
|
|
95
|
-
|
96
95
|
ConcurrentStream.setup sin, :pair => sout
|
97
96
|
ConcurrentStream.setup sout, :pair => sin
|
98
97
|
|
@@ -782,4 +781,13 @@ module Misc
|
|
782
781
|
ConcurrentStream.setup out, :threads => monitor_thread
|
783
782
|
end
|
784
783
|
|
784
|
+
def self.open_gz_pipe
|
785
|
+
sout = Misc.open_pipe do |sin|
|
786
|
+
yield sin
|
787
|
+
sin.close
|
788
|
+
end
|
789
|
+
|
790
|
+
Open.gzip(sout)
|
791
|
+
end
|
792
|
+
|
785
793
|
end
|
data/lib/rbbt/util/open.rb
CHANGED
data/lib/rbbt/workflow.rb
CHANGED
@@ -414,7 +414,7 @@ module Workflow
|
|
414
414
|
end if task.required_inputs
|
415
415
|
|
416
416
|
if missing_inputs.length == 1
|
417
|
-
raise ParameterException, "Input #{missing_inputs.first} is required but was not provided or is nil"
|
417
|
+
raise ParameterException, "Input '#{missing_inputs.first}' is required but was not provided or is nil"
|
418
418
|
end
|
419
419
|
|
420
420
|
if missing_inputs.length > 1
|
@@ -284,4 +284,41 @@ line4
|
|
284
284
|
end
|
285
285
|
end
|
286
286
|
end
|
287
|
+
|
288
|
+
def test_gz_pipe
|
289
|
+
text =<<-EOF
|
290
|
+
line1
|
291
|
+
line2
|
292
|
+
line3
|
293
|
+
line4
|
294
|
+
EOF
|
295
|
+
|
296
|
+
TmpFile.with_file nil, :extension => 'txt.gz' do |file|
|
297
|
+
sout = Misc.open_gz_pipe do |sin|
|
298
|
+
text.split("\n").each do |line|
|
299
|
+
sin.puts line
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
Open.mkdir File.basename(file)
|
304
|
+
thr1 = Misc.consume_stream(sout, true, file)
|
305
|
+
thr1.join
|
306
|
+
assert Open.gzip?(file)
|
307
|
+
assert_equal text, Open.read(file)
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
def test_open_pipe_error
|
312
|
+
sout = Misc.open_pipe do |sin|
|
313
|
+
10.times do |i|
|
314
|
+
sin.puts "line #{i}"
|
315
|
+
end
|
316
|
+
raise
|
317
|
+
end
|
318
|
+
|
319
|
+
TmpFile.with_file do |tmp|
|
320
|
+
#Misc.consume_stream(sout, false, tmp)
|
321
|
+
Open.write(tmp, sout)
|
322
|
+
end
|
323
|
+
end
|
287
324
|
end
|
data/test/rbbt/util/test_open.rb
CHANGED
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.33.
|
4
|
+
version: 5.33.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|