From aab12418af8bf7e9494f45e9b3249bff76fbae9c Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 7 Oct 2013 12:13:26 +0000 Subject: [PATCH] exchanged zlib code with commandline gzip git-svn-id: http://biopieces.googlecode.com/svn/trunk@2225 74ccb610-7750-0410-82ae-013aeee3265d --- code_ruby/lib/maasha/filesys.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code_ruby/lib/maasha/filesys.rb b/code_ruby/lib/maasha/filesys.rb index cee9e22..81190f5 100644 --- a/code_ruby/lib/maasha/filesys.rb +++ b/code_ruby/lib/maasha/filesys.rb @@ -22,7 +22,7 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -require 'zlib' +# require 'zlib' # require 'bzip2' require 'open3' @@ -50,7 +50,8 @@ class Filesys if mode == 'w' case options[:compress] when :gzip - ios = Zlib::GzipWriter.new File.open(file, mode, options) + # ios = Zlib::GzipWriter.new File.open(file, mode, options) + ios, = Open3.pipeline_w("gzip -f", out: file) when :bzip, :bzip2 # ios = Bzip2::Writer.new File.open(file, mode, options) # TODO being pissed with buggy bzip2 gem. ios, = Open3.pipeline_w("bzip2 -c", out: file) @@ -63,7 +64,8 @@ class Filesys else case `file -L #{file}` when /gzip/ - ios = Zlib::GzipReader.new File.open(file, mode, options) + # ios = Zlib::GzipReader.new File.open(file, mode, options) + ios = IO.popen("zcat #{file}") when /bzip/ # ios = Bzip2::Reader.new File.open(file, mode, options) # TODO this method is buggy, investigate ios = IO.popen("bzcat #{file}") -- 2.39.2