Skip to content
Snippets Groups Projects
Commit 2eaeebd6 authored by Alex Reisner's avatar Alex Reisner
Browse files

Kill ActiveSupport::JSON dependency.

Use JSON (json gem) instead.
parent f4a4ec75
No related branches found
No related tags found
No related merge requests found
require 'net/http' require 'net/http'
require 'active_support/json' require 'json'
module Geocoder module Geocoder
module Lookup module Lookup
...@@ -49,12 +49,14 @@ module Geocoder ...@@ -49,12 +49,14 @@ module Geocoder
# #
def fetch_data(query, reverse = false) def fetch_data(query, reverse = false)
begin begin
ActiveSupport::JSON.decode(fetch_raw_data(query, reverse)) JSON.parse(fetch_raw_data(query, reverse))
rescue SocketError rescue SocketError
warn "Geocoding API connection cannot be established." warn "Geocoding API connection cannot be established."
rescue TimeoutError rescue TimeoutError
warn "Geocoding API not responding fast enough " + warn "Geocoding API not responding fast enough " +
"(see Geocoder::Configuration.timeout to set limit)." "(see Geocoder::Configuration.timeout to set limit)."
rescue JSON::ParseError
warn "Geocoding API's response was not valid JSON."
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment