diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-21 12:19:43 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-21 12:19:43 +0000 |
commit | 57a639494a2a002f496a945979e2bf499b0d9fdb (patch) | |
tree | 53fadfc1666459e1286735a37171539883d66d70 /lib/rss/1.0.rb | |
parent | 754b1fac44487454cc25a14443615c0fba3da6ad (diff) |
* lib/rss.rb, lib/rss/, test/rss/, sample/rss/: merged from trunk.
- 0.1.6 -> 2.0.0.
- fixed image module URI. Thanks to Dmitry Borodaenko.
- supported Atom.
- supported ITunes module.
- supported Slash module.
* NEWS: added an entry for RSS Parser.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/1.0.rb')
-rw-r--r-- | lib/rss/1.0.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/rss/1.0.rb b/lib/rss/1.0.rb index a945434fbf..f04e61c5eb 100644 --- a/lib/rss/1.0.rb +++ b/lib/rss/1.0.rb @@ -45,10 +45,10 @@ module RSS __send__("install_have_#{type}_element", tag, ::RSS::URI, occurs) end - attr_accessor :rss_version, :version, :encoding, :standalone - + alias_method(:rss_version, :feed_version) def initialize(version=nil, encoding=nil, standalone=nil) super('1.0', version, encoding, standalone) + @feed_type = "rss" end def full_name @@ -430,21 +430,22 @@ module RSS end RSS10::ELEMENTS.each do |name| - BaseListener.install_get_text_element(URI, name, "#{name}=") + BaseListener.install_get_text_element(URI, name, name) end module ListenerMixin private - def start_RDF(tag_name, prefix, attrs, ns) + def initial_start_RDF(tag_name, prefix, attrs, ns) check_ns(tag_name, prefix, ns, RDF::URI) @rss = RDF.new(@version, @encoding, @standalone) @rss.do_validate = @do_validate @rss.xml_stylesheets = @xml_stylesheets @last_element = @rss - @proc_stack.push Proc.new { |text, tags| + pr = Proc.new do |text, tags| @rss.validate_for_stream(tags, @ignore_unknown_element) if @do_validate - } + end + @proc_stack.push(pr) end end |