1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/rss/content.rb
kou d731c29b06 * lib/rss/rss.rb, test/rss/test_version.rb: 0.2.0 -> 0.2.1.
* lib/rss/content.rb, lib/rss/content/1.0.rb,
  lib/rss/content/2.0.rb, lib/rss/maker/content.rb,
  test/rss/rss-testcase.rb, test/rss/test_content.rb,
  test/rss/test_maker_content.rb: supported content:encoded with RSS 2.0.
  Suggested by Sam Lown. Thanks.

* NEWS: added the above changes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-30 12:56:33 +00:00

31 lines
771 B
Ruby

require "rss/rss"
module RSS
CONTENT_PREFIX = 'content'
CONTENT_URI = "http://purl.org/rss/1.0/modules/content/"
module ContentModel
extend BaseModel
ELEMENTS = ["#{CONTENT_PREFIX}_encoded"]
def self.append_features(klass)
super
klass.install_must_call_validator(CONTENT_PREFIX, CONTENT_URI)
ELEMENTS.each do |full_name|
name = full_name[(CONTENT_PREFIX.size + 1)..-1]
klass.install_text_element(name, CONTENT_URI, "?", full_name)
end
end
end
prefix_size = CONTENT_PREFIX.size + 1
ContentModel::ELEMENTS.each do |full_name|
name = full_name[prefix_size..-1]
BaseListener.install_get_text_element(CONTENT_URI, name, full_name)
end
end
require 'rss/content/1.0'
require 'rss/content/2.0'