* lib/rss/rss.rb:

- cleanup validation mechanism. Now, #XXX_validation is
    needless.
  - changed internal variable name RSS::Element::MODEL to
    RSS::Element::MODELS.
  - RSS::Element.install_model requires uri.

* lib/rss/0.9.rb: followed new validation API.
* lib/rss/1.0.rb: ditto.
* lib/rss/2.0.rb: ditto.
* lib/rss/content.rb: ditto.
* lib/rss/dublincore.rb: ditto.
* lib/rss/image.rb: ditto.
* lib/rss/syndication.rb: ditto.
* lib/rss/taxonomy.rb: ditto.
* lib/rss/trackback.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2006-06-19 16:12:45 +00:00
parent eb41c8d2e3
commit b60b8361fd
11 changed files with 109 additions and 198 deletions

View file

@ -34,12 +34,10 @@ module RSS
super
klass.install_have_child_element("#{IMAGE_PREFIX}_item")
klass.install_must_call_validator(IMAGE_PREFIX, IMAGE_URI)
klass.install_model("item", IMAGE_URI, "?")
end
def image_validate(ignore_unknown_element, tags, uri)
validate_one_tag_name(ignore_unknown_element, "item", tags)
end
class ImageItem < Element
include RSS10
include DublinCoreModel
@ -56,6 +54,8 @@ module RSS
end
end
install_must_call_validator(IMAGE_PREFIX, IMAGE_URI)
[
["about", ::RSS::RDF::URI, true],
["resource", ::RSS::RDF::URI, false],
@ -120,13 +120,11 @@ module RSS
unless klass.class == Module
klass.install_have_child_element("#{IMAGE_PREFIX}_favicon")
klass.install_must_call_validator(IMAGE_PREFIX, IMAGE_URI)
klass.install_model("favicon", IMAGE_URI, "?")
end
end
def image_validate(ignore_unknown_element, tags, uri)
validate_one_tag_name(ignore_unknown_element, "favicon", tags)
end
class ImageFavicon < Element
include RSS10
include DublinCoreModel