Permalink
Browse files

Merge branch 'master' of git://github.com/jkrall/googleajax

  • Loading branch information...
2 parents ab2df14 + d4facf4 commit 4c08485954de6382d11949ee4500633704069569 Wesley Beary committed Jan 9, 2009
Showing with 6 additions and 2 deletions.
  1. +1 −1 lib/googleajax.rb
  2. +5 −1 lib/googleajax/parser.rb
View
@@ -2,7 +2,7 @@
require 'open-uri'
require 'ostruct'
require 'rubygems'
-require 'json'
+require 'json' unless defined? Rails
require 'googleajax/feed'
require 'googleajax/language'
View
@@ -1,7 +1,11 @@
class GoogleAjax
class Parser
def self.parse(api, method, data)
- data = JSON.parse(data)
+ if defined? Rails
+ data = ActiveSupport::JSON::decode(data)
+ else
+ data = JSON.parse(data)
+ end
Errors.process(data)
parser = Parser::PARSERS[api][method]
parser.process(data['responseData'])

0 comments on commit 4c08485

Please sign in to comment.