mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
eb41c8d2e3
commit
b60b8361fd
11 changed files with 109 additions and 198 deletions
|
@ -41,7 +41,7 @@ module RSS
|
|||
["item", "+"],
|
||||
["textinput", "?"],
|
||||
].each do |tag, occurs|
|
||||
install_model(tag, occurs)
|
||||
install_model(tag, ::RSS::URI, occurs)
|
||||
if occurs == "+"
|
||||
install_have_children_element(tag)
|
||||
else
|
||||
|
@ -121,7 +121,7 @@ module RSS
|
|||
@tag_name = 'Seq'
|
||||
|
||||
install_have_children_element("li")
|
||||
|
||||
install_model("li", URI, "*")
|
||||
install_must_call_validator('rdf', ::RSS::RDF::URI)
|
||||
|
||||
def initialize(*args)
|
||||
|
@ -147,10 +147,6 @@ module RSS
|
|||
def children
|
||||
@li
|
||||
end
|
||||
|
||||
def rdf_validate(ignore_unknown_element, tags, uri)
|
||||
_validate(ignore_unknown_element, tags, uri, [["li", '*']])
|
||||
end
|
||||
|
||||
def _tags
|
||||
rv = []
|
||||
|
@ -176,7 +172,7 @@ module RSS
|
|||
@tag_name = 'Bag'
|
||||
|
||||
install_have_children_element("li")
|
||||
|
||||
install_model("li", URI, "*")
|
||||
install_must_call_validator('rdf', ::RSS::RDF::URI)
|
||||
|
||||
def initialize(*args)
|
||||
|
@ -202,10 +198,6 @@ module RSS
|
|||
def children
|
||||
@li
|
||||
end
|
||||
|
||||
def rdf_validate(ignore_unknown_element, tags, uri)
|
||||
_validate(ignore_unknown_element, tags, uri, [["li", '*']])
|
||||
end
|
||||
|
||||
def _tags
|
||||
rv = []
|
||||
|
@ -251,7 +243,7 @@ module RSS
|
|||
['items', nil],
|
||||
['textinput', '?'],
|
||||
].each do |tag, occurs|
|
||||
install_model(tag, occurs)
|
||||
install_model(tag, ::RSS::URI, occurs)
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
|
@ -362,8 +354,8 @@ module RSS
|
|||
end
|
||||
|
||||
install_have_child_element("Seq")
|
||||
|
||||
install_must_call_validator('rdf', ::RSS::RDF::URI)
|
||||
install_model("Seq", URI, nil)
|
||||
install_must_call_validator('rdf', URI)
|
||||
|
||||
def initialize(*args)
|
||||
if Utils.element_initialize_arguments?(args)
|
||||
|
@ -395,10 +387,6 @@ module RSS
|
|||
rv << [URI, 'Seq'] unless @Seq.nil?
|
||||
rv
|
||||
end
|
||||
|
||||
def rdf_validate(ignore_unknown_element, tags, uri)
|
||||
_validate(ignore_unknown_element, tags, uri, [["Seq", nil]])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -430,7 +418,7 @@ module RSS
|
|||
['url', nil],
|
||||
['link', nil],
|
||||
].each do |tag, occurs|
|
||||
install_model(tag, occurs)
|
||||
install_model(tag, ::RSS::URI, occurs)
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
|
@ -487,7 +475,7 @@ module RSS
|
|||
["link", nil],
|
||||
["description", "?"],
|
||||
].each do |tag, occurs|
|
||||
install_model(tag, occurs)
|
||||
install_model(tag, ::RSS::URI, occurs)
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
|
@ -548,7 +536,7 @@ module RSS
|
|||
["name", nil],
|
||||
["link", nil],
|
||||
].each do |tag, occurs|
|
||||
install_model(tag, occurs)
|
||||
install_model(tag, ::RSS::URI, occurs)
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue