mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rss/rss.rb (RSS::Element#tag): not use block_given? for
working with ruby 1.6 again.
* lib/rss/{0.9,2.0,trackback}.rb, lib/rss/maker/base.rb:
undef -> remove_method for working with ruby 1.6 again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b684f87574
commit
0c616db7ff
6 changed files with 22 additions and 14 deletions
|
|
@ -517,7 +517,7 @@ EOC
|
|||
end
|
||||
end
|
||||
|
||||
def tag(indent, additional_attrs=[])
|
||||
def tag(indent, additional_attrs=[], &block)
|
||||
next_indent = indent + INDENT
|
||||
|
||||
attrs = collect_attrs
|
||||
|
|
@ -525,9 +525,9 @@ EOC
|
|||
|
||||
attrs += additional_attrs
|
||||
start_tag = make_start_tag(indent, next_indent, attrs)
|
||||
|
||||
if block_given?
|
||||
content = yield(next_indent)
|
||||
|
||||
if block
|
||||
content = block.call(next_indent)
|
||||
else
|
||||
content = []
|
||||
end
|
||||
|
|
@ -794,9 +794,9 @@ EOC
|
|||
end
|
||||
|
||||
private
|
||||
def tag(indent, attrs)
|
||||
def tag(indent, attrs, &block)
|
||||
rv = xmldecl + xml_stylesheet_pi
|
||||
rv << super
|
||||
rv << super(indent, attrs, &block)
|
||||
rv
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue