mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rss/rss.rb: RSS::Element#initialize accepts initial
attributes. * lib/rss/0.9.rb: ditto. * lib/rss/1.0.rb: ditto. * lib/rss/2.0.rb: ditto. * lib/rss/dublincore.rb: ditto. * lib/rss/image.rb: ditto. * lib/rss/taxonomy.rb: ditto. * lib/rss/trackback.rb: ditto. * lib/rss/utils.rb: added Utils.element_initialize_arguments? to detect backward compatibility initial arguments. * lib/rss/parser.rb: user initial attributes to initialize RSS::Element. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e6037e6111
commit
63c3fd6aa2
11 changed files with 256 additions and 120 deletions
|
@ -377,8 +377,7 @@ module RSS
|
|||
|
||||
check_ns(tag_name, prefix, ns, klass.required_uri)
|
||||
|
||||
args = []
|
||||
|
||||
attributes = {}
|
||||
klass.get_attributes.each do |a_name, a_uri, required|
|
||||
|
||||
if a_uri.is_a?(String) or !a_uri.respond_to?(:include?)
|
||||
|
@ -407,12 +406,11 @@ module RSS
|
|||
raise MissingAttributeError.new(tag_name, a_name)
|
||||
end
|
||||
|
||||
args << val
|
||||
attributes[a_name] = val
|
||||
end
|
||||
|
||||
previous = @last_element
|
||||
next_element = klass.new(*args)
|
||||
next_element.do_validate = @do_validate
|
||||
next_element = klass.new(@do_validate, attributes)
|
||||
previous.instance_eval {set_next_element(tag_name, next_element)}
|
||||
@last_element = next_element
|
||||
@proc_stack.push Proc.new { |text, tags|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue