]> git.donarmstrong.com Git - biopieces.git/commitdiff
added :data_out magic to Biopeices ruby code
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 31 Jan 2011 17:46:39 +0000 (17:46 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 31 Jan 2011 17:46:39 +0000 (17:46 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1230 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/Maasha/lib/biopieces.rb

index 9cd86edc9aacf9dd6e142ab4eb3fc8cfa9557792..52b9eeedf440965490441b496f2d70f4a22c5eb3 100644 (file)
@@ -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