aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/xml_mini/nokogiri.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-03-10 12:08:42 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-03-10 12:08:42 -0700
commit37cf224fdb7259c139450bc33c68ec09489be9c2 (patch)
tree4e207ec7fd5a934ab02a21c8c4b25598781e4e6f /activesupport/lib/active_support/xml_mini/nokogiri.rb
parent694998ee4fb8d257ba78424cab630846327a0889 (diff)
downloadrails-37cf224fdb7259c139450bc33c68ec09489be9c2.tar.gz
rails-37cf224fdb7259c139450bc33c68ec09489be9c2.tar.bz2
rails-37cf224fdb7259c139450bc33c68ec09489be9c2.zip
Make it easier to swap XmlMini backends. Require Nokogiri >= 1.1.1 for XmlMini backend tests.
Diffstat (limited to 'activesupport/lib/active_support/xml_mini/nokogiri.rb')
-rw-r--r--activesupport/lib/active_support/xml_mini/nokogiri.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/xml_mini/nokogiri.rb b/activesupport/lib/active_support/xml_mini/nokogiri.rb
index bfafa29dd5..5c8a6bfe89 100644
--- a/activesupport/lib/active_support/xml_mini/nokogiri.rb
+++ b/activesupport/lib/active_support/xml_mini/nokogiri.rb
@@ -1,4 +1,4 @@
-# = XML Mini Nokogiri implementation
+# = XmlMini Nokogiri implementation
module ActiveSupport
module XmlMini_Nokogiri #:nodoc:
extend self
@@ -7,8 +7,11 @@ module ActiveSupport
# string::
# XML Document string to parse
def parse(string)
- return {} if string.blank?
- doc = Nokogiri::XML(string).to_hash
+ if string.blank?
+ {}
+ else
+ Nokogiri::XML(string).to_hash
+ end
end
module Conversions