[BioRuby-cvs] bioruby/lib/bio/io keggapi.rb, 1.11, 1.12 pubmed.rb, 1.13, 1.14 registry.rb, 1.17, 1.18

Naohisa Goto ngoto at dev.open-bio.org
Fri Jul 14 14:48:58 UTC 2006


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

Modified Files:
	keggapi.rb pubmed.rb registry.rb 
Log Message:
* Changed to use Bio::Command.new_http instead of Net::HTTP.new.
* Changed to use Bio::Command.start_http instead of Net::HTTP.start.


Index: pubmed.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/pubmed.rb,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** pubmed.rb	16 Mar 2006 17:29:05 -0000	1.13
--- pubmed.rb	14 Jul 2006 14:48:56 -0000	1.14
***************
*** 24,27 ****
--- 24,28 ----
  require 'net/http'
  require 'cgi' unless defined?(CGI)
+ require 'bio/command'
  
  module Bio
***************
*** 86,90 ****
        path = "/entrez/query.fcgi?tool=bioruby&cmd=Search&doptcmdl=MEDLINE&db=PubMed&term="
  
!       http = Net::HTTP.new(host)
        response, = http.get(path + CGI.escape(str))
        result = response.body
--- 87,91 ----
        path = "/entrez/query.fcgi?tool=bioruby&cmd=Search&doptcmdl=MEDLINE&db=PubMed&term="
  
!       http = Bio::Command.new_http(host)
        response, = http.get(path + CGI.escape(str))
        result = response.body
***************
*** 123,127 ****
        path = "/entrez/eutils/esearch.fcgi?tool=bioruby&db=pubmed&#{opts.join('&')}&term="
  
!       http = Net::HTTP.new(host)
        response, = http.get(path + CGI.escape(str))
        result = response.body
--- 124,128 ----
        path = "/entrez/eutils/esearch.fcgi?tool=bioruby&db=pubmed&#{opts.join('&')}&term="
  
!       http = Bio::Command.new_http(host)
        response, = http.get(path + CGI.escape(str))
        result = response.body
***************
*** 140,144 ****
        path = "/entrez/query.fcgi?tool=bioruby&cmd=Text&dopt=MEDLINE&db=PubMed&uid="
  
!       http = Net::HTTP.new(host)
        response, = http.get(path + id.to_s)
        result = response.body
--- 141,145 ----
        path = "/entrez/query.fcgi?tool=bioruby&cmd=Text&dopt=MEDLINE&db=PubMed&uid="
  
!       http = Bio::Command.new_http(host)
        response, = http.get(path + id.to_s)
        result = response.body
***************
*** 161,165 ****
        path = "/entrez/utils/pmfetch.fcgi?tool=bioruby&mode=text&report=medline&db=PubMed&id="
  
!       http = Net::HTTP.new(host)
        response, = http.get(path + id.to_s)
        result = response.body
--- 162,166 ----
        path = "/entrez/utils/pmfetch.fcgi?tool=bioruby&mode=text&report=medline&db=PubMed&id="
  
!       http = Bio::Command.new_http(host)
        response, = http.get(path + id.to_s)
        result = response.body
***************
*** 189,193 ****
        ids = ids.join(",")
  
!       http = Net::HTTP.new(host)
        response, = http.get(path + ids)
        result = response.body
--- 190,194 ----
        ids = ids.join(",")
  
!       http = Bio::Command.new_http(host)
        response, = http.get(path + ids)
        result = response.body

Index: registry.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/registry.rb,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** registry.rb	8 May 2006 14:29:58 -0000	1.17
--- registry.rb	14 Jul 2006 14:48:56 -0000	1.18
***************
*** 85,88 ****
--- 85,89 ----
  require 'uri'
  require 'net/http'
+ require 'bio/command'
  
  
***************
*** 171,175 ****
    def read_remote(url)
      schema, user, host, port, reg, path, = URI.split(url)
!     Net::HTTP.start(host, port) do |http|
        response, = http.get(path)
        parse_stanza(response.body)
--- 172,176 ----
    def read_remote(url)
      schema, user, host, port, reg, path, = URI.split(url)
!     Bio::Command.start_http(host, port) do |http|
        response, = http.get(path)
        parse_stanza(response.body)

Index: keggapi.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/keggapi.rb,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** keggapi.rb	18 Dec 2005 19:10:55 -0000	1.11
--- keggapi.rb	14 Jul 2006 14:48:56 -0000	1.12
***************
*** 24,27 ****
--- 24,28 ----
  require 'uri'
  require 'net/http'
+ require 'bio/command'
  
  module Bio
***************
*** 96,100 ****
      filename ||= File.basename(path)
  
!     http = Net::HTTP.new(host, port)
      response, = http.get(path)
      File.open(filename, "w+") do |f|
--- 97,101 ----
      filename ||= File.basename(path)
  
!     http = Bio::Command.new_http(host, port)
      response, = http.get(path)
      File.open(filename, "w+") do |f|




More information about the bioruby-cvs mailing list