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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87f3c2c6750c49c90cce3fd4f8e24d270d471538f65374e388ec6ac83bf7134c
4
- data.tar.gz: fb4909c5ef2ab2a751271f1f49db270ea1f91c4a84ed26504ddebebf23aae75a
3
+ metadata.gz: 563841b942e1b0cf4a97bed6900bd51c96df63ec993d3a5280faadbf7b8eb753
4
+ data.tar.gz: c2cd78f5dfe5061f97021fd2121dd415d7b6c36c1fef2fc9f496c2cc985e4c4d
5
5
  SHA512:
6
- metadata.gz: 39ca36640608cc39e279e0402f55749d5851b3713ee1fabe1eac414ae8ec5bf8f3a7741a71551142aede5ba27c9143b54972720fe321c563ac47b5db4a868da6
7
- data.tar.gz: a7f50b0bb6829c781c9b8081b63464997f1d2aa1e8ab68871af6d13799867f4f136385b704e1bf5badce2ed03171db421ba5f9452d491b02c96aa8fe36d8eeea
6
+ metadata.gz: 6382e73cdb35ff7ab7dcd3de894a192353c39edef06ddaeb030ec376089b638acb0f62f468153433dfb0e3b0242a44146bfaeb1770ef35ee7175200caeea5e12
7
+ data.tar.gz: '08b8ce8d556f25269c671b6307972669927b468975c77d188b572e2285627968989a2db68de7fa2983908cb7d4cf3a236f0908a78d3917ea46ad84f82c60f536'
@@ -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
@@ -748,6 +748,7 @@ module Open
748
748
  raise $!
749
749
  end
750
750
  content.close
751
+ content.join if content.respond_to? :join
751
752
  end
752
753
  end
753
754
 
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
@@ -356,5 +356,5 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
356
356
  end
357
357
 
358
358
  puts
359
- puts "Found #{count} jobs"
359
+ puts Log.color :clear, "Found #{count} jobs"
360
360
 
@@ -356,5 +356,5 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
356
356
  end
357
357
 
358
358
  puts
359
- puts "Found #{count} jobs"
359
+ puts Log.color :clear, "Found #{count} jobs"
360
360
 
@@ -356,5 +356,5 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
356
356
  end
357
357
 
358
358
  puts
359
- puts "Found #{count} jobs"
359
+ puts Log.color :clear, "Found #{count} jobs"
360
360
 
@@ -469,7 +469,7 @@ begin
469
469
  end
470
470
 
471
471
  if options.delete(:printpath)
472
- job.join
472
+ job.join if job.running?
473
473
  raise job.messages.last if (job.error? || job.aborted?) && job.messages
474
474
  if Open.remote? job.path
475
475
  puts job.url + Log.color(:blue, "?_format=raw")
@@ -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
@@ -186,6 +186,6 @@ class TestOpen < Test::Unit::TestCase
186
186
  end
187
187
 
188
188
  end
189
-
189
+
190
190
  end
191
191
 
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.20
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-05-30 00:00:00.000000000 Z
11
+ date: 2022-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake