From 2eaeebd6da8b56087d07042db62e0bb66fab7626 Mon Sep 17 00:00:00 2001
From: Alex Reisner <alex@alexreisner.com>
Date: Fri, 4 Mar 2011 10:54:00 -0500
Subject: [PATCH] Kill ActiveSupport::JSON dependency.

Use JSON (json gem) instead.
---
 lib/geocoder/lookups/base.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/geocoder/lookups/base.rb b/lib/geocoder/lookups/base.rb
index 4045c6b5..c8d84340 100644
--- a/lib/geocoder/lookups/base.rb
+++ b/lib/geocoder/lookups/base.rb
@@ -1,5 +1,5 @@
 require 'net/http'
-require 'active_support/json'
+require 'json'
 
 module Geocoder
   module Lookup
@@ -49,12 +49,14 @@ module Geocoder
       #
       def fetch_data(query, reverse = false)
         begin
-          ActiveSupport::JSON.decode(fetch_raw_data(query, reverse))
+          JSON.parse(fetch_raw_data(query, reverse))
         rescue SocketError
           warn "Geocoding API connection cannot be established."
         rescue TimeoutError
           warn "Geocoding API not responding fast enough " +
             "(see Geocoder::Configuration.timeout to set limit)."
+        rescue JSON::ParseError
+          warn "Geocoding API's response was not valid JSON."
         end
       end
 
-- 
GitLab