From: martinahansen Date: Fri, 18 Mar 2011 15:18:19 +0000 (+0000) Subject: polishing stdin for ruby code X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=26cb0176a14e6c7bb789444afd39195b6763890e;p=biopieces.git polishing stdin for ruby code git-svn-id: http://biopieces.googlecode.com/svn/trunk@1292 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_python/Cjung/Args.pyc b/code_python/Cjung/Args.pyc index ddc36fc..66b245e 100644 Binary files a/code_python/Cjung/Args.pyc and b/code_python/Cjung/Args.pyc differ diff --git a/code_ruby/Maasha/lib/biopieces.rb b/code_ruby/Maasha/lib/biopieces.rb index 44f0d22..2ab9aa7 100644 --- a/code_ruby/Maasha/lib/biopieces.rb +++ b/code_ruby/Maasha/lib/biopieces.rb @@ -453,7 +453,7 @@ class OptionHandler def options_check_files(cast) if cast[:type] == 'files!' and @options.has_key? cast[:long] @options[cast[:long]].each do |path| - raise ArgumentError, "No such file: '#{path}'" unless File.file? path + raise ArgumentError, "File not readable: '#{path}'" unless File.readable? path end end end diff --git a/code_ruby/Maasha/lib/fastq.rb b/code_ruby/Maasha/lib/fastq.rb index fc2863a..2988785 100644 --- a/code_ruby/Maasha/lib/fastq.rb +++ b/code_ruby/Maasha/lib/fastq.rb @@ -34,7 +34,11 @@ class Fastq # Class method allowing open to be used on (zipped) files. # See File.open. def self.open(*args) - ios = self.zopen(*args) + if File.pipe? *args.first + ios = self.new(File.open(*args)) + else + ios = self.zopen(*args) + end if block_given? begin