aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rss/maker/0.9.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-11 12:06:26 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-11 12:06:26 +0000
commit876e1b87e7c0f2175932d7814c4ffbd272e01471 (patch)
treecb1d87a72fd558e9b97ac2f9811ce47bc5809a62 /lib/rss/maker/0.9.rb
parent7ff55ae6bbed1e508837325e35a2fadd4471aa36 (diff)
downloadruby-876e1b87e7c0f2175932d7814c4ffbd272e01471.tar.gz
* lib/rss/maker.rb, lib/rss/maker/0.9.rb, lib/rss/maker/base.rb:
RSS::Maker.[] returns a maker class corresponds to passed version. * test/rss/test_maker_*.rb: add tests for RSS::Maker.[]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/maker/0.9.rb')
-rw-r--r--lib/rss/maker/0.9.rb54
1 files changed, 47 insertions, 7 deletions
diff --git a/lib/rss/maker/0.9.rb b/lib/rss/maker/0.9.rb
index 72b14dc977..cc7db8c638 100644
--- a/lib/rss/maker/0.9.rb
+++ b/lib/rss/maker/0.9.rb
@@ -7,7 +7,7 @@ module RSS
class RSS09 < RSSBase
- def initialize(feed_version="0.92")
+ def initialize(feed_version)
super
@feed_type = "rss"
end
@@ -457,11 +457,51 @@ module RSS
end
end
end
-
- add_maker("0.9", "0.92", RSS09)
- add_maker("0.91", "0.91", RSS09)
- add_maker("0.92", "0.92", RSS09)
- add_maker("rss0.91", "0.91", RSS09)
- add_maker("rss0.92", "0.92", RSS09)
+
+ class RSS091 < RSS09
+ def initialize(feed_version="0.91")
+ super
+ end
+
+ class Channel < RSS09::Channel
+ end
+
+ class Items < RSS09::Items
+ class Item < RSS09::Items::Item
+ end
+ end
+
+ class Image < RSS09::Image
+ end
+
+ class Textinput < RSS09::Textinput
+ end
+ end
+
+ class RSS092 < RSS09
+ def initialize(feed_version="0.92")
+ super
+ end
+
+ class Channel < RSS09::Channel
+ end
+
+ class Items < RSS09::Items
+ class Item < RSS09::Items::Item
+ end
+ end
+
+ class Image < RSS09::Image
+ end
+
+ class Textinput < RSS09::Textinput
+ end
+ end
+
+ add_maker("0.9", "0.92", RSS092)
+ add_maker("0.91", "0.91", RSS091)
+ add_maker("0.92", "0.92", RSS092)
+ add_maker("rss0.91", "0.91", RSS091)
+ add_maker("rss0.92", "0.92", RSS092)
end
end