зеркало из https://github.com/github/ruby.git
* 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:
Родитель
8db864c999
Коммит
4fc4f5215b
|
@ -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
|
||||
|
|
|
@ -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
|
Загрузка…
Ссылка в новой задаче