From 45fcdf0e5e5b07bb8cd3b2ea6db03e20403395ce Mon Sep 17 00:00:00 2001 From: kou Date: Sat, 17 Jun 2006 00:26:41 +0000 Subject: * lib/rss, test/rss: backported from trunk. (2005-11-16 - now) * lib/rss/maker/taxonomy.rb: implemented taxonomy module for RSS Maker. * lib/rss/taxonomy.rb: supported RSS Maker. * lib/rss/maker.rb: added taxonomy module support. * lib/rss/rss.rb: adjusted to other element API. * lib/rss/1.0.rb: adjusted to other element API but backward compatibility is reserved. * lib/rss/0.9.rb: ditto. * test/rss/test_maker_taxo.rb: added test case for taxonomy module for RSS Maker. * test/rss/test_setup_maker_1.0.rb: added tests for taxo:topic. * test/rss/test_setup_maker_1.0.rb: added backward compatibility test. * test/rss/test_setup_maker_0.9.rb: ditto. * test/rss/test_setup_maker_2.0.rb: ditto. * test/rss/rss-testcase.rb: added convenience method for setting up taxo:topic. * test/rss/rss-assertions.rb: added assertion for taxo:topic. * sample/rss/blend.rb: followed new API. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rss/1.0.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'lib/rss/1.0.rb') diff --git a/lib/rss/1.0.rb b/lib/rss/1.0.rb index 5c7e3f5e6..00d8c3abd 100644 --- a/lib/rss/1.0.rb +++ b/lib/rss/1.0.rb @@ -170,6 +170,12 @@ module RSS tag_name_with_prefix(PREFIX) end + def setup_maker(target) + lis.each do |li| + target << li.resource + end + end + private def children @li @@ -224,6 +230,12 @@ module RSS tag_name_with_prefix(PREFIX) end + def setup_maker(target) + lis.each do |li| + target << li.resource + end + end + private def children @li @@ -600,8 +612,12 @@ module RSS ] end - def maker_target(maker) - maker.items.new_item + def maker_target(items) + if items.respond_to?("items") + # For backward compatibility + items = items.items + end + items.new_item end end -- cgit