mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
using a merge with a Hash[] rather than a loop to add SAX parsed attributes
This commit is contained in:
parent
437ceab139
commit
254b0a4bbb
2 changed files with 2 additions and 3 deletions
2
Gemfile
2
Gemfile
|
@ -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 @@ module ActiveSupport
|
|||
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]
|
||||
|
|
Loading…
Reference in a new issue