[BioRuby-cvs] bioruby/lib/bio/io fetch.rb,1.5,1.6

Naohisa Goto ngoto at pub.open-bio.org
Mon Mar 20 12:40:16 UTC 2006


Update of /home/repository/bioruby/bioruby/lib/bio/io
In directory pub.open-bio.org:/tmp/cvs-serv30167/lib/bio/io

Modified Files:
	fetch.rb 
Log Message:
* "require 'open-uri'" is removed because open-uri.rb changes Kernel#open.
  Instead, Bio::Command::NetTools.read_uri is used.
* query should be escaped by using URI.escape.
* Bio::Fetch#databases, #formats are changed to return an array of string,
  as described in the documents.
* Bio::Fetch#maxids are changed to return an Integer number,
  as described in the document.


Index: fetch.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/fetch.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** fetch.rb	16 Mar 2006 17:29:05 -0000	1.5
--- fetch.rb	20 Mar 2006 12:40:13 -0000	1.6
***************
*** 26,30 ****
  
  require 'uri'
! require 'open-uri'
  
  module Bio
--- 26,30 ----
  
  require 'uri'
! require 'bio/command'
  
  module Bio
***************
*** 105,110 ****
        query = query.join('&')
    
!       result = open(@url + '?' + query).readlines.join('')
!       return result
      end
    
--- 105,109 ----
        query = query.join('&')
    
!       Bio::Command::NetTools.read_uri(@url + '?' + URI.escape(query))
      end
    
***************
*** 141,146 ****
        query = "info=dbs"
  
!       result = open(@url + '?' + query).readlines.join('')
!       return result
      end
    
--- 140,144 ----
        query = "info=dbs"
  
!       Bio::Command::NetTools.read_uri(@url + '?' + URI.escape(query)).strip.split(/\s+/)
      end
    
***************
*** 159,164 ****
          query = "info=formats;db=#{database}"
  
!         result = open(@url + '?' + query).readlines.join('')
!         return result
        end
      end
--- 157,161 ----
          query = "info=formats;db=#{database}"
  
!         Bio::Command::NetTools.read_uri(@url + '?' + URI.escape(query)).strip.split(/\s+/)
        end
      end
***************
*** 174,179 ****
        query = "info=maxids"
  
!       result = open(@url + '?' + query).readlines.join('')
!       return result
      end
    
--- 171,175 ----
        query = "info=maxids"
  
!       Bio::Command::NetTools.read_uri(@url + '?' + URI.escape(query)).to_i
      end
    




More information about the bioruby-cvs mailing list