Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove yaml coercion from the XML parser

  • Loading branch information...
commit 633974b2759d9b924657f3888473d5fd681538dd 1 parent b4f9817
@dkubb dkubb authored
Showing with 2 additions and 3 deletions.
  1. +0 −1  lib/extlib/hash.rb
  2. +2 −2 spec/hash_spec.rb
View
1  lib/extlib/hash.rb
@@ -284,7 +284,6 @@ class REXMLUtilityNode
self.typecasts["float"] = lambda{|v| v.nil? ? nil : v.to_f}
self.typecasts["symbol"] = lambda{|v| v.to_sym}
self.typecasts["string"] = lambda{|v| v.to_s}
- self.typecasts["yaml"] = lambda{|v| v.nil? ? nil : YAML.load(v)}
self.typecasts["base64Binary"] = lambda{|v| v.unpack('m').first }
self.available_typecasts = self.typecasts.keys
View
4 spec/hash_spec.rb
@@ -254,7 +254,7 @@
'approved' => nil,
'written_on' => nil,
'viewed_at' => nil,
- 'content' => nil,
+ 'content' => { 'type' => 'yaml' },
'parent_id' => nil
}
Hash.from_xml(topic_xml)["topic"].should == expected_topic_hash
@@ -292,7 +292,7 @@
# Changed this line where the key is :message. The yaml specifies this as a symbol, and who am I to change what you specify
# The line in ActiveSupport is
# 'content' => { 'message' => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
- 'content' => { :message => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
+ 'content' => "--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true\n",
'author_email_address' => "david@loudthinking.com",
'parent_id' => nil,
'ad_revenue' => BigDecimal("1.50"),
Please sign in to comment.
Something went wrong with that request. Please try again.