diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-28 06:59:34 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-28 06:59:34 +0000 |
commit | 0c616db7ff406d8f3454807aa0e3310629d53ee3 (patch) | |
tree | 55e685bca967a5c798a8f64beec86b90c32dcec7 /lib/rss/rss.rb | |
parent | b684f87574166a42d3305c005896bf2aa7cd37b3 (diff) | |
download | ruby-0c616db7ff406d8f3454807aa0e3310629d53ee3.tar.gz |
* 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
Diffstat (limited to 'lib/rss/rss.rb')
-rw-r--r-- | lib/rss/rss.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index 9bf94986e7..c180a70b5d 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -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 |