From 12ddbdaec6416e5d8652a60764d43f00807a1373 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 31 Jan 2011 17:46:39 +0000 Subject: [PATCH] added :data_out magic to Biopeices ruby code git-svn-id: http://biopieces.googlecode.com/svn/trunk@1230 74ccb610-7750-0410-82ae-013aeee3265d --- code_ruby/Maasha/lib/biopieces.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code_ruby/Maasha/lib/biopieces.rb b/code_ruby/Maasha/lib/biopieces.rb index 9cd86ed..52b9eee 100644 --- a/code_ruby/Maasha/lib/biopieces.rb +++ b/code_ruby/Maasha/lib/biopieces.rb @@ -562,12 +562,18 @@ end class Stream < IO # Open Biopieces output data stream for reading from stdin or a file # specified in options[:stream_in] OR writing to stdout or a file - # specified in options[:stream_out]. + # specified in options[:stream_out] or options[:data_out]. def self.open(options, mode, stdio) if mode == "r" $stdin.tty? ? read(options[:stream_in]) : stdio elsif mode == "w" - options[:stream_out] ? self.write(options[:stream_out], options[:compress]) : stdio + if options[:stream_out] + self.write(options[:stream_out], options[:compress]) + elsif options[:data_out] + self.write(options[:data_out], options[:compress]) + else + stdio + end else raise "Bad mode #{mode}" end -- 2.39.5