public
Rubygem
Description: Makes http fun! Also, makes consuming restful web services dead easy.
Homepage:
Clone URL: git://github.com/jnunemaker/httparty.git
Click here to lend your support to: httparty and make a donation at www.pledgie.com !
Switched json and xml deserializers to json gem and included 
ToHashParser#from_xml
jnunemaker (author)
Sat Dec 06 19:16:21 -0800 2008
commit  c0ad5dece3d15f8549f5292ad678c7b18a939ccb
tree    151daeef7b4a7e0d072d533bddf3e890b107163a
parent  057e3f1a19426a61913f59fac7189e0a47b6dfa5
...
3
4
5
 
 
6
7
8
...
96
97
98
99
100
 
 
101
...
3
4
5
6
7
8
9
10
...
98
99
100
 
101
102
103
104
0
@@ -3,6 +3,8 @@ $:.unshift(File.dirname(__FILE__))
0
 require 'net/http'
0
 require 'net/https'
0
 require 'rubygems'
0
+gem 'json', '>= 1.1.3'
0
+require 'json'
0
 require 'active_support'
0
 require 'module_level_inheritable_attributes'
0
 
0
@@ -96,4 +98,5 @@ module HTTParty
0
 end
0
 
0
 require 'httparty/exceptions'
0
-require 'httparty/request'
0
\ No newline at end of file
0
+require 'httparty/request'
0
+require 'httparty/xml'
0
\ No newline at end of file
...
104
105
106
107
 
108
109
 
110
111
112
...
104
105
106
 
107
108
 
109
110
111
112
0
@@ -104,9 +104,9 @@ module HTTParty
0
         return nil if body.nil? or body.empty?
0
         case format
0
         when :xml
0
-          Hash.from_xml(body)
0
+          ToHashParser.from_xml(body)
0
         when :json
0
-          ActiveSupport::JSON.decode(body)
0
+          JSON.parse(body)
0
         else
0
           body
0
         end
...
198
199
200
201
202
 
 
203
204
205
...
198
199
200
 
 
201
202
203
204
205
0
@@ -198,8 +198,8 @@ class REXMLUtilityNode
0
   end
0
 end
0
 
0
-class HashFromXml
0
-  def self.create(xml)
0
+class ToHashParser
0
+  def self.from_xml(xml)
0
     stack = []
0
     parser = REXML::Parsers::BaseParser.new(xml)
0
 

Comments