Commit 35cfab6c authored by Andreas Tille's avatar Andreas Tille

New upstream version 1.5.1

parent ce160497
This diff is collapsed.
= BioRuby 1.5.1 RELEASE NOTES
Few changes have been made to the BioRuby 1.5.1 after the version 1.5.0 is
released.
== NEWS
=== HTTPS is used to access NCBI web services
As you may know, NCBI announced that all HTTP resources will be switched
to HTTPS on September 30, 2016. To follow the transition, all URLs for
accessing NCBI E-utilities in BioRuby are changed to use HTTPS.
In BioRuby, the following classes/modules are affected.
* Bio::NCBI::REST and descending classes
* Bio::PubMed
In some rare cases (especially when building Ruby and/or OpenSSL by yourself
from source code), Ruby does not include SSL/TLS support, or Ruby fails to
detect SSL root certificates. In such cases, you may need to reinstall or
upgrade Ruby, OpenSSL (or alternatives), and/or SSL root certificates with
appropriate configuration options. Alternatively, installing binary packages
is generally a good idea.
= BioRuby 1.5.0 RELEASE NOTES
A lot of changes have been made to the BioRuby 1.5.0 after the version 1.4.3
......@@ -21,7 +47,7 @@ This release is the final BioRuby version that can be run on Ruby 1.8.
BioRuby is distributed under the same license as Ruby's. In October 2011,
Ruby's License was changed from a dual license with GPLv2 to a dual license
with 2-clause BSDL.available. Since BioRuby 1.5.0, we have updated to the
with 2-clause BSDL. Since BioRuby 1.5.0, we have updated to the
new version of Ruby's License. For details about the license, see COPYING
or COPYING.ja and BSDL. In addition, please do not forget to see LEGAL for
exception files that are subjected to different licenses.
......@@ -29,7 +55,7 @@ exception files that are subjected to different licenses.
=== Semantic Versioning will be introduced
We will adopt the Semantic Versioning since the next release version, which
will be BioRuby 1.5.1. This means that BioRuby 1.5.0 are NOT subject to the
will be BioRuby 1.5.1. This means that BioRuby 1.5.0 is NOT subject to the
Semantic Versioning.
......
......@@ -3,7 +3,7 @@
#
Gem::Specification.new do |s|
s.name = 'bio'
s.version = "1.5.0"
s.version = "1.5.1"
s.author = "BioRuby project"
s.email = "staff@bioruby.org"
......
......@@ -13,6 +13,7 @@ require 'uri'
require 'open-uri'
require 'cgi'
require 'net/http'
require 'net/https'
require 'tmpdir'
require 'fileutils'
......@@ -706,6 +707,43 @@ module Command
OpenURI.open_uri(uri).read
end
# Same as:
# Net::HTTP.start(uri.address, uri.port)
# and
# it uses proxy if an environment variable (same as OpenURI.open_uri)
# is set.
# It supports https.
#
# Note: This method ignores uri.path.
# It only uses uri.address and uri.port.
#
# ---
# *Arguments*:
# * (required) _uri_: URI object or String containing URI
# *Returns*:: (same as Net::HTTP::start except for proxy and https support)
def start_http_uri(uri, &block)
unless uri.is_a?(URI)
uri = URI.parse(uri)
end
# Note: URI#find_proxy is an unofficial method defined in open-uri.rb.
# If the spec of open-uri.rb would be changed, we should change below.
if proxyuri = uri.find_proxy then
raise 'Non-HTTP proxy' if proxyuri.class != URI::HTTP
klass = Net::HTTP.Proxy(proxyuri.host, proxyuri.port)
else
klass = Net::HTTP
end
http = klass.new(uri.host, uri.port)
case uri.scheme
when 'https'
http.use_ssl = true
end
http.start(&block)
end
# Same as:
# Net::HTTP.start(address, port)
# and
......@@ -813,7 +851,7 @@ module Command
}
hash.update(header)
start_http(uri.host, uri.port) do |http|
start_http_uri(uri) do |http|
http.post(uri.path, data, hash)
end
end
......@@ -937,7 +975,7 @@ module Command
}
hash.update(header)
start_http(uri.host, uri.port) do |http|
start_http_uri(uri) do |http|
http.post(uri.path, data, hash)
end
end
......
......@@ -20,13 +20,13 @@ class NCBI
# They may also be used for other NCBI services.
ENTREZ_DEFAULT_PARAMETERS = {
# Cited from
# http://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.Release_Notes
# https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.Release_Notes
# tool:
# Name of application making the E-utility call.
# Value must be a string with no internal spaces.
'tool' => "bioruby",
# Cited from
# http://www.ncbi.nlm.nih.gov/books/NBK25497/
# https://www.ncbi.nlm.nih.gov/books/NBK25497/
# The value of email should be a complete and valid e-mail address
# of the software developer and not that of a third-party end user.
'email' => 'staff@bioruby.org',
......@@ -54,7 +54,7 @@ class NCBI
# Sets default email address used for Entrez (eUtils).
# It may also be used for other NCBI services.
#
# In http://www.ncbi.nlm.nih.gov/books/NBK25497/
# In https://www.ncbi.nlm.nih.gov/books/NBK25497/
# NCBI says:
# "The value of email should be a complete and valid e-mail address of
# the software developer and not that of a third-party end user."
......@@ -89,7 +89,7 @@ class NCBI
# Sets default tool name for Entrez (eUtils).
# It may also be used for other NCBI services.
#
# In http://www.ncbi.nlm.nih.gov/books/NBK25497/
# In https://www.ncbi.nlm.nih.gov/books/NBK25497/
# NCBI says:
# "The value of tool should be a string with no internal spaces that
# uniquely identifies the software producing the request."
......@@ -111,9 +111,10 @@ class NCBI
#
# The Bio::NCBI::REST class provides REST client for the NCBI E-Utilities
#
# Entrez utilities index:
# Entrez Programming Utilities Help:
#
# * http://www.ncbi.nlm.nih.gov/entrez/utils/utils_index.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25501/
# * ( redirected from http://www.ncbi.nlm.nih.gov/entrez/utils/ )
#
class REST
......@@ -197,7 +198,7 @@ class REST
# List the NCBI database names E-Utils (einfo) service
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi
# * https://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi
#
# pubmed protein nucleotide nuccore nucgss nucest structure genome
# books cancerchromosomes cdd gap domains gene genomeprj gensat geo
......@@ -215,7 +216,7 @@ class REST
# ---
# *Returns*:: array of string (database names)
def einfo
serv = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi"
serv = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi"
opts = default_parameters.merge({})
response = ncbi_post_form(serv, opts)
result = response.body
......@@ -229,8 +230,9 @@ class REST
#
# For information on the possible arguments, see
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html
# * http://www.ncbi.nlm.nih.gov/books/bv.fcgi?rid=helppubmed.section.pubmedhelp.Search_Field_Descrip
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.ESearch
# * ( redirected from http://eutils.ncbi.nlm.nih.gov/books/n/helpeutils/chapter4/#chapter4.ESearch )
# * ( redirected from http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html )
#
# == Usage
#
......@@ -282,7 +284,7 @@ class REST
# * _step_: maximum number of entries retrieved at a time
# *Returns*:: array of entry IDs or a number of results
def esearch(str, hash = {}, limit = nil, step = 10000)
serv = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi"
serv = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi"
opts = default_parameters.merge({ "term" => str })
opts.update(hash)
......@@ -313,7 +315,7 @@ class REST
# *Arguments*:: same as esearch method
# *Returns*:: array of entry IDs or a number of results
def esearch_count(str, hash = {})
serv = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi"
serv = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi"
opts = default_parameters.merge({ "term" => str })
opts.update(hash)
opts.update("rettype" => "count")
......@@ -328,7 +330,7 @@ class REST
#
# For information on the possible arguments, see
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetch_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
#
# == Usage
#
......@@ -351,7 +353,7 @@ class REST
# * _step_: maximum number of entries retrieved at a time
# *Returns*:: String
def efetch(ids, hash = {}, step = 100)
serv = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi"
serv = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi"
opts = default_parameters.merge({ "retmode" => "text" })
opts.update(hash)
......@@ -396,12 +398,12 @@ class REST
# Search database entries by given keywords using E-Utils (esearch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.ESearch
#
# sequences = gene + genome + nucleotide + protein + popset + snp
# nucleotide = nuccore + nucest + nucgss
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi
# * https://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi
#
# pubmed protein nucleotide nuccore nucgss nucest structure genome
# books cancerchromosomes cdd gap domains gene genomeprj gensat geo
......@@ -517,7 +519,7 @@ class REST
# Retrieve sequence entries by given IDs using E-Utils (efetch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchseq_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
#
# sequences = gene + genome + nucleotide + protein + popset + snp
# nucleotide = nuccore + nucest + nucgss
......@@ -581,7 +583,7 @@ class REST
# Retrieve nucleotide sequence entries by given IDs using E-Utils
# (efetch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchseq_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
# nucleotide = nuccore + nucest + nucgss
#
# format (rettype):
......@@ -643,7 +645,7 @@ class REST
# Retrieve protein sequence entries by given IDs using E-Utils
# (efetch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchseq_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
# protein
#
# format (rettype):
......@@ -699,7 +701,7 @@ class REST
# Retrieve PubMed entries by given IDs using E-Utils (efetch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchlit_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
#
# == Usage
#
......@@ -741,7 +743,7 @@ class REST
# Retrieve PubMed Central entries by given IDs using E-Utils (efetch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchlit_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
#
# == Usage
#
......@@ -776,7 +778,7 @@ class REST
# Retrieve journal entries by given IDs using E-Utils (efetch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchlit_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
#
# == Usage
#
......@@ -811,7 +813,7 @@ class REST
# Retrieve OMIM entries by given IDs using E-Utils (efetch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchlit_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
#
# == Usage
#
......@@ -849,7 +851,7 @@ class REST
# Retrieve taxonomy entries by given IDs using E-Utils (efetch).
#
# * http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchtax_help.html
# * https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch
#
# == Usage
#
......
......@@ -10,7 +10,7 @@
module Bio
# BioRuby version (Array containing Integer)
BIORUBY_VERSION = [1, 5, 0].extend(Comparable).freeze
BIORUBY_VERSION = [1, 5, 1].extend(Comparable).freeze
# Extra version specifier (String or nil).
# Existance of the value indicates development version.
......@@ -22,7 +22,7 @@ module Bio
# By default, if the third digit (teeny) of BIORUBY_VERSION is 0,
# the version is regarded as a development version.
BIORUBY_EXTRA_VERSION =
nil #(BIORUBY_VERSION[2] == 0) ? "-dev" : nil
nil #"-dev" #(BIORUBY_VERSION[2] == 0) ? "-dev" : nil
# Version identifier, including extra version string (String)
# Unlike BIORUBY_VERSION, it is not comparable.
......
This diff is collapsed.
......@@ -13,6 +13,7 @@ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 2,
# libraries needed for the tests
require 'test/unit'
require 'uri'
require 'bio/command'
module Bio
......@@ -22,6 +23,7 @@ module Bio
@port = 80
@path = "/"
@url = "http://bioruby.open-bio.org:80/"
@uri = URI.parse(@url)
end
def test_read_uri
......@@ -32,6 +34,21 @@ module Bio
assert(!str.to_s.empty?)
end
def test_start_http_uri
ht = Bio::Command.start_http_uri(@uri)
assert_kind_of(Net::HTTP, ht)
res = ht.get(@path)
assert_kind_of(Net::HTTPResponse, res)
end
def test_start_http_uri_with_block
res = Bio::Command.start_http_uri(@uri) do |ht|
assert_kind_of(Net::HTTP, ht)
ht.get(@path)
end
assert_kind_of(Net::HTTPResponse, res)
end
def test_start_http
ht = Bio::Command.start_http(@host, @port)
assert_kind_of(Net::HTTP, ht)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment