2004-11-01 03:43:47 +03:00
|
|
|
require "rss/rss"
|
|
|
|
|
|
|
|
module RSS
|
|
|
|
module Maker
|
|
|
|
MAKERS = {}
|
2007-03-17 13:13:25 +03:00
|
|
|
|
2004-11-01 03:43:47 +03:00
|
|
|
class << self
|
2004-11-19 11:25:25 +03:00
|
|
|
def make(version, &block)
|
2007-03-17 13:13:25 +03:00
|
|
|
m = maker(version)
|
|
|
|
raise UnsupportedMakerVersionError.new(version) if m.nil?
|
2008-02-11 11:24:18 +03:00
|
|
|
m[:maker].make(m[:version], &block)
|
2004-11-01 03:43:47 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def maker(version)
|
|
|
|
MAKERS[version]
|
|
|
|
end
|
|
|
|
|
2008-02-11 11:24:18 +03:00
|
|
|
def add_maker(version, normalized_version, maker)
|
|
|
|
MAKERS[version] = {:maker => maker, :version => normalized_version}
|
2004-11-01 03:43:47 +03:00
|
|
|
end
|
|
|
|
|
2007-03-17 13:13:25 +03:00
|
|
|
def versions
|
|
|
|
MAKERS.keys.uniq.sort
|
|
|
|
end
|
|
|
|
|
|
|
|
def makers
|
2008-02-11 11:24:18 +03:00
|
|
|
MAKERS.values.collect {|info| info[:maker]}.uniq
|
2004-11-01 03:43:47 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2004-11-19 11:25:25 +03:00
|
|
|
|
|
|
|
require "rss/maker/1.0"
|
|
|
|
require "rss/maker/2.0"
|
2007-03-17 13:13:25 +03:00
|
|
|
require "rss/maker/feed"
|
|
|
|
require "rss/maker/entry"
|
2004-11-19 11:25:25 +03:00
|
|
|
require "rss/maker/content"
|
|
|
|
require "rss/maker/dublincore"
|
2007-09-15 08:41:28 +04:00
|
|
|
require "rss/maker/slash"
|
2004-11-19 11:25:25 +03:00
|
|
|
require "rss/maker/syndication"
|
2005-11-23 12:24:17 +03:00
|
|
|
require "rss/maker/taxonomy"
|
2004-11-19 11:25:25 +03:00
|
|
|
require "rss/maker/trackback"
|
2005-02-03 18:31:57 +03:00
|
|
|
require "rss/maker/image"
|
2007-08-05 07:03:05 +04:00
|
|
|
require "rss/maker/itunes"
|