mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rss/maker.rb: added entry point of RSS Maker.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8db864c999
commit
4fc4f5215b
3 changed files with 38 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Nov 1 09:37:19 2004 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rss/maker.rb: added entry point of RSS Maker.
|
||||
|
||||
Mon Nov 1 01:14:52 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* io.c (rb_f_open): create copy of popen specifier. [ruby-dev:24656]
|
||||
|
|
1
MANIFEST
1
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
|
||||
|
|
33
lib/rss/maker.rb
Normal file
33
lib/rss/maker.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue