aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/xml_mini
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 20:20:22 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 20:20:22 +0200
commitb326e82dc012d81e9698cb1f402502af1788c1e9 (patch)
tree6b6452129a5b6b684f3d44f21afd2b1bea83fa22 /activesupport/lib/active_support/xml_mini
parent80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (diff)
downloadrails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.gz
rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.bz2
rails-b326e82dc012d81e9698cb1f402502af1788c1e9.zip
applies remaining conventions across the project
Diffstat (limited to 'activesupport/lib/active_support/xml_mini')
-rw-r--r--activesupport/lib/active_support/xml_mini/libxml.rb7
-rw-r--r--activesupport/lib/active_support/xml_mini/libxmlsax.rb7
-rw-r--r--activesupport/lib/active_support/xml_mini/nokogiri.rb6
-rw-r--r--activesupport/lib/active_support/xml_mini/nokogirisax.rb7
4 files changed, 12 insertions, 15 deletions
diff --git a/activesupport/lib/active_support/xml_mini/libxml.rb b/activesupport/lib/active_support/xml_mini/libxml.rb
index 1be962d2b1..8a4aa03963 100644
--- a/activesupport/lib/active_support/xml_mini/libxml.rb
+++ b/activesupport/lib/active_support/xml_mini/libxml.rb
@@ -22,7 +22,6 @@ module ActiveSupport
LibXML::XML::Parser.io(data).parse.to_hash
end
end
-
end
end
@@ -46,9 +45,9 @@ module LibXML #:nodoc:
# Insert node hash into parent hash correctly.
case hash[name]
- when Array then hash[name] << node_hash
- when Hash then hash[name] = [hash[name], node_hash]
- when nil then hash[name] = node_hash
+ when Array then hash[name] << node_hash
+ when Hash then hash[name] = [hash[name], node_hash]
+ when nil then hash[name] = node_hash
end
# Handle child elements
diff --git a/activesupport/lib/active_support/xml_mini/libxmlsax.rb b/activesupport/lib/active_support/xml_mini/libxmlsax.rb
index e907d610a1..4edb0bd2b1 100644
--- a/activesupport/lib/active_support/xml_mini/libxmlsax.rb
+++ b/activesupport/lib/active_support/xml_mini/libxmlsax.rb
@@ -9,7 +9,6 @@ module ActiveSupport
# Class that will build the hash while the XML document
# is being parsed using SAX events.
class HashBuilder
-
include LibXML::XML::SaxParser::Callbacks
CONTENT_KEY = "__content__".freeze
@@ -36,9 +35,9 @@ module ActiveSupport
new_hash[HASH_SIZE_KEY] = new_hash.size + 1
case current_hash[name]
- when Array then current_hash[name] << new_hash
- when Hash then current_hash[name] = [current_hash[name], new_hash]
- when nil then current_hash[name] = new_hash
+ when Array then current_hash[name] << new_hash
+ when Hash then current_hash[name] = [current_hash[name], new_hash]
+ when nil then current_hash[name] = new_hash
end
@hash_stack.push(new_hash)
diff --git a/activesupport/lib/active_support/xml_mini/nokogiri.rb b/activesupport/lib/active_support/xml_mini/nokogiri.rb
index 7c32b2a07b..b92fa7ea7c 100644
--- a/activesupport/lib/active_support/xml_mini/nokogiri.rb
+++ b/activesupport/lib/active_support/xml_mini/nokogiri.rb
@@ -49,9 +49,9 @@ module ActiveSupport
# Insert node hash into parent hash correctly.
case hash[name]
- when Array then hash[name] << node_hash
- when Hash then hash[name] = [hash[name], node_hash]
- when nil then hash[name] = node_hash
+ when Array then hash[name] << node_hash
+ when Hash then hash[name] = [hash[name], node_hash]
+ when nil then hash[name] = node_hash
end
# Handle child elements
diff --git a/activesupport/lib/active_support/xml_mini/nokogirisax.rb b/activesupport/lib/active_support/xml_mini/nokogirisax.rb
index d4dc90787d..b8b85146c5 100644
--- a/activesupport/lib/active_support/xml_mini/nokogirisax.rb
+++ b/activesupport/lib/active_support/xml_mini/nokogirisax.rb
@@ -14,7 +14,6 @@ module ActiveSupport
# Class that will build the hash while the XML document
# is being parsed using SAX events.
class HashBuilder < Nokogiri::XML::SAX::Document
-
CONTENT_KEY = "__content__".freeze
HASH_SIZE_KEY = "__hash_size__".freeze
@@ -42,9 +41,9 @@ module ActiveSupport
new_hash[HASH_SIZE_KEY] = new_hash.size + 1
case current_hash[name]
- when Array then current_hash[name] << new_hash
- when Hash then current_hash[name] = [current_hash[name], new_hash]
- when nil then current_hash[name] = new_hash
+ when Array then current_hash[name] << new_hash
+ when Hash then current_hash[name] = [current_hash[name], new_hash]
+ when nil then current_hash[name] = new_hash
end
@hash_stack.push(new_hash)