diff options
| author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-17 10:13:25 +0000 |
|---|---|---|
| committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-17 10:13:25 +0000 |
| commit | c3adb681b3e5281044d5bebd91851fd9afea0b8a (patch) | |
| tree | 847090e856c9901ab2cc19251c179b9b0985e65b /lib/rss/content.rb | |
| parent | 8c9c2f26929b0f077188546492d38dddaa966b9a (diff) | |
| download | ruby-c3adb681b3e5281044d5bebd91851fd9afea0b8a.tar.gz ruby-c3adb681b3e5281044d5bebd91851fd9afea0b8a.tar.xz ruby-c3adb681b3e5281044d5bebd91851fd9afea0b8a.zip | |
* lib/rss, test/rss:
- supported Atom.
- bumped version 0.1.6 to 0.1.7.
* sample/rss/convert.rb: added new sample.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/content.rb')
| -rw-r--r-- | lib/rss/content.rb | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/lib/rss/content.rb b/lib/rss/content.rb index a732cec97..bb61d9ebc 100644 --- a/lib/rss/content.rb +++ b/lib/rss/content.rb @@ -15,28 +15,13 @@ module RSS def self.append_features(klass) super - - klass.module_eval(<<-EOC, *get_file_and_line_from_caller(1)) - %w(encoded).each do |name| - install_text_element("\#{CONTENT_PREFIX}_\#{name}") - end - EOC - end - - def content_validate(tags) - counter = {} - ELEMENTS.each do |name| - counter[name] = 0 - end - tags.each do |tag| - key = "#{CONTENT_PREFIX}_#{tag}" - raise UnknownTagError.new(tag, CONTENT_URI) unless counter.has_key?(key) - counter[key] += 1 - raise TooMuchTagError.new(tag, tag_name) if counter[key] > 1 + klass.install_must_call_validator(CONTENT_PREFIX, CONTENT_URI) + %w(encoded).each do |name| + klass.install_text_element(name, CONTENT_URI, "?", + "#{CONTENT_PREFIX}_#{name}") end end - end class RDF @@ -47,7 +32,7 @@ module RSS ContentModel::ELEMENTS.uniq! ContentModel::ELEMENTS.each do |full_name| name = full_name[prefix_size..-1] - BaseListener.install_get_text_element(CONTENT_URI, name, "#{full_name}=") + BaseListener.install_get_text_element(CONTENT_URI, name, full_name) end end |
