提交 254b0a4b 编写于 作者: A Aaron Patterson

using a merge with a Hash[] rather than a loop to add SAX parsed attributes

上级 437ceab1
......@@ -39,7 +39,7 @@ end
platforms :ruby do
gem 'json'
gem 'yajl-ruby'
gem "nokogiri", ">= 1.4.3.1"
gem "nokogiri", ">= 1.4.4"
# AR
gem "sqlite3-ruby", "~> 1.3.1", :require => 'sqlite3'
......
......@@ -38,8 +38,7 @@ def error(error_message)
end
def start_element(name, attrs = [])
new_hash = { CONTENT_KEY => '' }
new_hash[attrs.shift] = attrs.shift while attrs.length > 0
new_hash = { CONTENT_KEY => '' }.merge(Hash[attrs])
new_hash[HASH_SIZE_KEY] = new_hash.size + 1
case current_hash[name]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册