rbbt-util 5.21.80 → 5.21.81

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: 6643742cb59acfc08425d4ec6c6796bd300fada7
4
- data.tar.gz: 2351b438d3a5f6f270e54643fd82b3d5466f8e69
3
+ metadata.gz: 766488431c24999dc06dbf6b06f7541e1ce0c0da
4
+ data.tar.gz: ef2edb51a1ea3d2591ba43aa3350162a043724ac
5
5
  SHA512:
6
- metadata.gz: ad3faa128f65be8d20566da34e756ac9c68ae4766450982ba61fdfb5e599e3593427e2c4ca86d03694796d42f74167b1528f2ef6cc23b7368c604baf45af98d6
7
- data.tar.gz: ee4da1fc28221199b1418f868aff6324a6c4b9f21aa6293de2b4f3c2160b8613d172f40b9503748084382718eaa5bdf325795632eab79ae75b7f187989586ac1
6
+ metadata.gz: b902a43f746f2c0eb1b0340b320c149487c8bab0edaff78d21950296e0565955ca342a1624e0d1f38a2065dbe6a9f7e2ccf578dfe6f2043a531154628be35312
7
+ data.tar.gz: 9cb934bec141ad0870e3644d25bf5c31f19ea26427ce1a74f1991fcc56e0ea7fac3961b2f455ddcb838dac74ad3549f8155ecb5b5fd2576d7139e552624f702a
@@ -563,7 +563,13 @@ module TSV
563
563
  options[:type] = :list if unmerge
564
564
 
565
565
  TSV::Dumper.stream options do |dumper|
566
- dumper.init unless no_options
566
+ case no_options
567
+ when FalseClass, nil
568
+ dumper.init
569
+ when Hash
570
+ dumper.init(no_options)
571
+ end
572
+
567
573
  begin
568
574
  if keys
569
575
  keys.each do |key|
@@ -598,7 +604,7 @@ module TSV
598
604
  end
599
605
 
600
606
  def to_s(keys = nil, no_options = false, unmerge = false)
601
- if FalseClass === keys or TrueClass === keys
607
+ if FalseClass === keys or TrueClass === keys or Hash === keys
602
608
  no_options = keys
603
609
  keys = nil
604
610
  end
@@ -90,9 +90,11 @@ module R
90
90
  $stdout.reopen File.new('/dev/null', 'w')
91
91
  exec(ENV, cmd)
92
92
  end
93
- while not File.exist? pid_file
94
- sleep 0.5
93
+
94
+ Misc.insist(10, 0.5, false) do
95
+ raise "Rserve did not start" unless File.exist? pid_file
95
96
  end
97
+
96
98
  @@instance_process = Open.read(pid_file).to_i
97
99
  Log.info "New Rserver session stated with PID (#{sh_pid}) #{@@instance_process}: #{SESSION}"
98
100
  end
@@ -158,6 +158,8 @@ def self.add_libdir(dir=nil)
158
158
  rescue Exception
159
159
  if msg
160
160
  Log.warn("Insisting after exception: #{$!.class} #{$!.message} -- #{msg}")
161
+ elsif FalseClass === msg
162
+ nil
161
163
  else
162
164
  Log.warn("Insisting after exception: #{$!.class} #{$!.message}")
163
165
  end
@@ -267,8 +267,12 @@ module Misc
267
267
  end
268
268
 
269
269
  if in_thread
270
- Thread.new do
271
- consume_stream(io, false, into, into_close)
270
+ Thread.new(Thread.current) do |parent|
271
+ begin
272
+ consume_stream(io, false, into, into_close)
273
+ rescue Exception
274
+ parent.raise $!
275
+ end
272
276
  end
273
277
  else
274
278
  if into
@@ -279,7 +283,11 @@ module Misc
279
283
 
280
284
  begin
281
285
  into = into.find if Path === into
282
- into_path, into = into, Open.open(into, :mode => 'w') if String === into
286
+ if String === into
287
+ dir = File.dirname(into)
288
+ FileUtils.mkdir_p dir unless Open.exists?(dir)
289
+ into_path, into = into, Open.open(into, :mode => 'w')
290
+ end
283
291
  into.sync = true if IO === into
284
292
  into_close = false unless into.respond_to? :close
285
293
  io.sync = true
@@ -304,7 +312,6 @@ module Misc
304
312
  rescue Exception
305
313
  Log.medium "Exception consuming stream: #{Misc.fingerprint io}: #{$!.message}"
306
314
  io.abort $! if io.respond_to? :abort
307
- #io.close unless io.closed?
308
315
  FileUtils.rm into_path if into_path and File.exists? into_path
309
316
  raise $!
310
317
  end
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.21.80
4
+ version: 5.21.81
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-28 00:00:00.000000000 Z
11
+ date: 2017-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake