ruby-geonames
ruby-geonames copied to clipboard
Support JRuby-9.2.x.x
Please support JRuby-9.2.x.x
.
The Net::HTTP
call made in
def WebService.make_request(path_and_query, *args)
url = Geonames.base_url + path_and_query
url += "&username=#{Geonames.username}" if Geonames.username
url += "&password=#{Geonames.password}" if Geonames.password
url += "&radius=#{Geonames.radius}"
url += "&lang=#{Geonames.lang}"
options = {
:open_timeout => 60,
:read_timeout => 60
}
options.update(args.last.is_a?(::Hash) ? args.pop : {})
uri = URI.parse(url)
req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
Net::HTTP.start(uri.host, uri.port) { |http|
http.read_timeout = options[:read_timeout]
http.open_timeout = options[:open_timeout]
http.request(req)
}
end
fails with "NoMethodError: undefined method `<<' for {:read_timeout=>60, :continue_timeout=>nil, :debug_output=>nil}:Hash", when JRuby-9.2.9.0
is used.
It works with when JRuby-9.1.13.0
is used.