diff --git a/ChangeLog b/ChangeLog index 84d7c2ba6c..19e56dd89b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Nov 1 09:37:19 2004 Kouhei Sutou + + * lib/rss/maker.rb: added entry point of RSS Maker. + Mon Nov 1 01:14:52 2004 Yukihiro Matsumoto * io.c (rb_f_open): create copy of popen specifier. [ruby-dev:24656] diff --git a/MANIFEST b/MANIFEST index c9d7560ab1..d2b1752cbd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -361,6 +361,7 @@ lib/rss/2.0.rb lib/rss/content.rb lib/rss/converter.rb lib/rss/dublincore.rb +lib/rss/maker.rb lib/rss/maker/0.9.rb lib/rss/maker/1.0.rb lib/rss/maker/2.0.rb diff --git a/lib/rss/maker.rb b/lib/rss/maker.rb new file mode 100644 index 0000000000..c158c726c3 --- /dev/null +++ b/lib/rss/maker.rb @@ -0,0 +1,33 @@ +require "rss/rss" + +module RSS + + module Maker + + MAKERS = {} + + class << self + def make(version, modules=[], &block) + prefix = "rss/maker" + require "#{prefix}/#{version}" + modules.each do |mod| + require "#{prefix}/#{mod}" + end + maker(version).make(&block) + end + + def maker(version) + MAKERS[version] + end + + def add_maker(version, maker) + MAKERS[version] = maker + end + + def filename_to_version(filename) + File.basename(filename, ".*") + end + end + end + +end