lib/jvertica.rb in jvertica-0.0.2 vs lib/jvertica.rb in jvertica-0.0.3
- old
+ new
@@ -108,18 +108,17 @@
else
raise InvalidObject.new("source must be a IO.")
end
elsif block_given?
- rio, wio = IO.pipe
+ i, o = IO.pipe
begin
- yield(wio)
- stream.addStream org.jruby.util.IOInputStream.new(rio)
+ yield(o)
+ o.close
+ stream.addStream org.jruby.util.IOInputStream.new(i)
rescue => e
raise e
ensure
- wio.close
- rio.close
end
end
rescue => e
r = stream.finish