ruby-geonames icon indicating copy to clipboard operation
ruby-geonames copied to clipboard

Support JRuby-9.2.x.x

Open ThomasKoppensteiner opened this issue 5 years ago • 0 comments

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.

ThomasKoppensteiner avatar Dec 12 '19 10:12 ThomasKoppensteiner