lib/relaton_iho/iho_bibliography.rb in relaton-iho-1.14.3 vs lib/relaton_iho/iho_bibliography.rb in relaton-iho-1.16.0
- old
+ new
@@ -14,10 +14,10 @@
# @return [RelatonIho::IhoBibliographicItem, nil] the IHO standard or nil if not found
#
def search(text, _year = nil, _opts = {}) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
warn "[relaton-iho] (\"#{text}\") fetching..."
ref = text.sub(/^IHO\s/, "").sub(/^([[:alpha:]]+)(\d+)/, '\1-\2')
- index = Relaton::Index.find_or_create :IHO, url: "#{ENDPOINT}index.zip"
+ index = Relaton::Index.find_or_create :iho, url: "#{ENDPOINT}index.zip"
row = index.search(ref).max_by { |r| r[:id] }
return unless row
uri = URI("#{ENDPOINT}#{row[:file]}")
resp = Net::HTTP.get_response uri