From 26cb0176a14e6c7bb789444afd39195b6763890e Mon Sep 17 00:00:00 2001 From: martinahansen Date: Fri, 18 Mar 2011 15:18:19 +0000 Subject: [PATCH] polishing stdin for ruby code git-svn-id: http://biopieces.googlecode.com/svn/trunk@1292 74ccb610-7750-0410-82ae-013aeee3265d --- code_python/Cjung/Args.pyc | Bin 5364 -> 5601 bytes code_ruby/Maasha/lib/biopieces.rb | 2 +- code_ruby/Maasha/lib/fastq.rb | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code_python/Cjung/Args.pyc b/code_python/Cjung/Args.pyc index ddc36fc600f13f1a86a119e0c8fadcd00d0064e1..66b245e94a16f34c4cd693215c8322410309cd50 100644 GIT binary patch delta 835 zcma))F;Bu!6h`kY&^}55i>M4FI3P)*k(4+%kf?z~OdLc8=LU#?6{5w6iGvBV(@R|4 zjSDvJu8wXJC*$OZ@dtPt5EqBn^tK)P&iUTgejD%0%>4?hufyu@fHmZF5dgAIw{vP8 z*3Im()jO}-Hr*|!VP$vPPS>(+Zn71AFR$Vif0MUTdBCm$O$N;%^Z`0yz?u)XOSJ%0 z+6a7I`4q*LG7N*L(NvLwNHj7{fyQ~EOYZ@?WVqwEYz{O0k)?fPaEGjcVv4d_M8Y31CSN7w)8^a%)^oTC5P)k)Y9$}w?~@6=k=7TOl#sBdLjbg_loj?L^b7kRc{GLo!yTTi&lf<{WTydxX9zNBVmB+ P#-0V!Q#0uBLA>w-91Y%U delta 601 zcmaE;{Y8`G;wN6NjZrS%8#yxA1PmA$81yspb5r$m6BCOw5+^6}s!ra?X3AJQ`8}JX zj3onO2|Gh32SX+&Lo)+IJ{JRH3NwSdM+z%L@MM4Xm)P|;awyxdGIBEV0C6%S&;}+T zW&>hpATB-!Br4W3lmLxe&cIm1z>vwvkjVrxzLt@phLIs(dGZ4emCfv&8I0JC-@zr% z$U6B3mnLJ}WF~G+85sr^pkY8GvbY%Xc^MdiAcYa+NG6~oy|^D^ni9xkXoAUA=X1vI9aks&xdPXuTM#C#5j`5>b&^5kF|oyZ%gZwN9*5Md0^Yd|w3 z;bx$_@d9$QFZb>QD*?iK#I8l 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 -- 2.39.5