aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/xml_mini/libxmlsax.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/xml_mini/libxmlsax.rb')
-rw-r--r--activesupport/lib/active_support/xml_mini/libxmlsax.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/xml_mini/libxmlsax.rb b/activesupport/lib/active_support/xml_mini/libxmlsax.rb
index 70a95299ec..e907d610a1 100644
--- a/activesupport/lib/active_support/xml_mini/libxmlsax.rb
+++ b/activesupport/lib/active_support/xml_mini/libxmlsax.rb
@@ -1,6 +1,6 @@
-require 'libxml'
-require 'active_support/core_ext/object/blank'
-require 'stringio'
+require "libxml"
+require "active_support/core_ext/object/blank"
+require "stringio"
module ActiveSupport
module XmlMini_LibXMLSAX #:nodoc:
@@ -12,8 +12,8 @@ module ActiveSupport
include LibXML::XML::SaxParser::Callbacks
- CONTENT_KEY = '__content__'.freeze
- HASH_SIZE_KEY = '__hash_size__'.freeze
+ CONTENT_KEY = "__content__".freeze
+ HASH_SIZE_KEY = "__hash_size__".freeze
attr_reader :hash
@@ -22,7 +22,7 @@ module ActiveSupport
end
def on_start_document
- @hash = { CONTENT_KEY => '' }
+ @hash = { CONTENT_KEY => "" }
@hash_stack = [@hash]
end
@@ -32,7 +32,7 @@ module ActiveSupport
end
def on_start_element(name, attrs = {})
- new_hash = { CONTENT_KEY => '' }.merge!(attrs)
+ new_hash = { CONTENT_KEY => "" }.merge!(attrs)
new_hash[HASH_SIZE_KEY] = new_hash.size + 1
case current_hash[name]
@@ -45,7 +45,7 @@ module ActiveSupport
end
def on_end_element(name)
- if current_hash.length > current_hash.delete(HASH_SIZE_KEY) && current_hash[CONTENT_KEY].blank? || current_hash[CONTENT_KEY] == ''
+ if current_hash.length > current_hash.delete(HASH_SIZE_KEY) && current_hash[CONTENT_KEY].blank? || current_hash[CONTENT_KEY] == ""
current_hash.delete(CONTENT_KEY)
end
@hash_stack.pop
@@ -63,7 +63,7 @@ module ActiveSupport
def parse(data)
if !data.respond_to?(:read)
- data = StringIO.new(data || '')
+ data = StringIO.new(data || "")
end
char = data.getc