]> git.donarmstrong.com Git - biopieces.git/commitdiff
polishing stdin for ruby code
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 18 Mar 2011 15:18:19 +0000 (15:18 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 18 Mar 2011 15:18:19 +0000 (15:18 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1292 74ccb610-7750-0410-82ae-013aeee3265d

code_python/Cjung/Args.pyc
code_ruby/Maasha/lib/biopieces.rb
code_ruby/Maasha/lib/fastq.rb

index ddc36fc600f13f1a86a119e0c8fadcd00d0064e1..66b245e94a16f34c4cd693215c8322410309cd50 100644 (file)
Binary files a/code_python/Cjung/Args.pyc and b/code_python/Cjung/Args.pyc differ
index 44f0d22994b35199b9fc2cea07776cc1532c6627..2ab9aa71ce462df296744e94d1e79181fb463034 100644 (file)
@@ -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
index fc2863a781a2a59726010c55530d98d4d53d81f9..298878590711be9240e5f4bc2ba33c6cf1cc4d20 100644 (file)
@@ -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