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 !
Added missing to_xml_attributes method to hash
jnunemaker (author)
Mon Dec 08 18:30:26 -0800 2008
commit  6f361ed59e11ca29e4967c876567be7cf8e9cca7
tree    3af2edd1d75319cc13369946facedac0a69faaea
parent  a0f8ade61b7ffb732ae0cdaf1262dc74b1f4e5dc
...
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
0
@@ -1,3 +1,7 @@
0
+== 0.2.2 2008-12-08
0
+* 1 bug fix
0
+  * Added the missing core extension hash method to_xml_attributes
0
+
0
 == 0.2.1 2008-12-08
0
 * 1 bug fix
0
   * Fixed that HTTParty was borking ActiveSupport and as such Rails (thanks to Rob Sanheim)
...
333
334
335
 
 
 
 
 
 
 
 
 
 
 
336
337
...
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
0
@@ -333,4 +333,15 @@ class Hash
0
 
0
     param
0
   end
0
+  
0
+  # @return <String> The hash as attributes for an XML tag.
0
+  #
0
+  # @example
0
+  #   { :one => 1, "two"=>"TWO" }.to_xml_attributes
0
+  #     #=> 'one="1" two="TWO"'
0
+  def to_xml_attributes
0
+    map do |k,v|
0
+      %{#{k.to_s.snake_case.sub(/^(.{1,1})/) { |m| m.downcase }}="#{v}"}
0
+    end.join(' ')
0
+  end
0
 end
0
\ No newline at end of file
...
1
2
 
3
4
...
1
 
2
3
4
0
@@ -1,3 +1,3 @@
0
 module HTTParty
0
-  Version = '0.2.1'
0
+  Version = '0.2.2'
0
 end
0
\ No newline at end of file

Comments

kennethkalmer Mon Dec 08 19:52:03 -0800 2008

Thanks John, this fixed the issue reported in this gist: http://gist.github.com/33647