mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rss, test/rss: backported from trunk. (2005-11-16 - now)
* lib/rss/image.rb: added Image prefix. * lib/rss/maker/image.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7461f297e9
commit
2da88324a2
3 changed files with 19 additions and 4 deletions
|
@ -8,6 +8,14 @@ module RSS
|
|||
|
||||
RDF.install_ns(IMAGE_PREFIX, IMAGE_URI)
|
||||
|
||||
IMAGE_ELEMENTS = []
|
||||
|
||||
%w(item favicon).each do |name|
|
||||
class_name = Utils.to_class_name(name)
|
||||
BaseListener.install_class_name(IMAGE_URI, name, "Image#{class_name}")
|
||||
IMAGE_ELEMENTS << "#{IMAGE_PREFIX}_#{name}"
|
||||
end
|
||||
|
||||
module ImageModelUtils
|
||||
def validate_one_tag_name(name, tags)
|
||||
invalid = tags.find {|tag| tag != name}
|
||||
|
@ -30,10 +38,12 @@ module RSS
|
|||
validate_one_tag_name("item", tags)
|
||||
end
|
||||
|
||||
class Item < Element
|
||||
class ImageItem < Element
|
||||
include RSS10
|
||||
include DublinCoreModel
|
||||
|
||||
@tag_name = "item"
|
||||
|
||||
class << self
|
||||
def required_prefix
|
||||
IMAGE_PREFIX
|
||||
|
@ -144,10 +154,12 @@ module RSS
|
|||
validate_one_tag_name("favicon", tags)
|
||||
end
|
||||
|
||||
class Favicon < Element
|
||||
class ImageFavicon < Element
|
||||
include RSS10
|
||||
include DublinCoreModel
|
||||
|
||||
@tag_name = "favicon"
|
||||
|
||||
class << self
|
||||
def required_prefix
|
||||
IMAGE_PREFIX
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue