lib/relaton_iso/iso_bibliography.rb in relaton-iso-0.6.4 vs lib/relaton_iso/iso_bibliography.rb in relaton-iso-0.6.5
- old
+ new
@@ -13,11 +13,11 @@
# @return [RelatonIso::HitPages]
def search(text)
HitCollection.new text
rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
- OpenSSL::SSL::SSLError
+ OpenSSL::SSL::SSLError, Errno::ETIMEDOUT
raise RelatonBib::RequestError, "Could not access http://www.iso.org"
end
# @param text [String]
# @return [Array<RelatonIso::IsoBibliographicItem>]
@@ -32,15 +32,16 @@
# @return [String] Relaton XML serialisation of reference
def get(code, year, opts)
%r{
^(?<code1>[^\s]+\s[^/]+) # match code
/?
- (?<corr>(Amd|DAmd|CD Amd|Cor|CD Cor)\s\d+:?(\d{4})?(/Cor \d+:\d{4})?) # match correction
+ (?<corr>(Amd|DAmd|(CD|WD|AWI|NP)\sAmd|Cor|CD\sCor|FDAmd)\s\d+ # correction name
+ :?(\d{4})?(/Cor\s\d+:\d{4})?) # match correction year
}x =~ code
code = code1 if code1
if year.nil?
- /^(?<code1>[^\s]+\s[\d-]+):?(?<year1>\d{4})?/ =~ code
+ /^(?<code1>[^\s]+(\s\w+)?\s[\d-]+):?(?<year1>\d{4})?/ =~ code
unless code1.nil?
code = code1
year = year1
end
end