diff options
| author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-13 15:06:58 +0000 |
|---|---|---|
| committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-13 15:06:58 +0000 |
| commit | 638dcfc85972b931647098d05a8dcd123025c364 (patch) | |
| tree | ae53ccaee48b23a01886918df61f6f10458df8d8 /lib | |
| parent | 017d62fab5705b26d1e15710c409fbe0ddc3acbc (diff) | |
| download | ruby-638dcfc85972b931647098d05a8dcd123025c364.tar.gz ruby-638dcfc85972b931647098d05a8dcd123025c364.tar.xz ruby-638dcfc85972b931647098d05a8dcd123025c364.zip | |
* lib/rss/rss.rb: 0.1.8 -> 0.1.9.
* test/rss/test_version.rb: followed the above change.
* lib/rss/parser.rb: fixed a bug that handles unintended elements.
Thanks to Takuo Yonezawa. [ruby-list:43841]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/rss/parser.rb | 9 | ||||
| -rw-r--r-- | lib/rss/rss.rb | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/rss/parser.rb b/lib/rss/parser.rb index b7a76397b..bf3b0b5d0 100644 --- a/lib/rss/parser.rb +++ b/lib/rss/parser.rb @@ -365,10 +365,10 @@ module RSS def start_else_element(local, prefix, attrs, ns) class_name = self.class.class_name(_ns(ns, prefix), local) current_class = @last_element.class - next_class = nil - begin + if current_class.const_defined?(class_name) next_class = current_class.const_get(class_name) - rescue NameError + start_have_something_element(local, prefix, attrs, ns, next_class) + else if !@do_validate or @ignore_unknown_element @proc_stack.push(nil) else @@ -379,9 +379,6 @@ module RSS raise NotExpectedTagError.new(local, _ns(ns, prefix), parent) end end - if next_class - start_have_something_element(local, prefix, attrs, ns, next_class) - end end NAMESPLIT = /^(?:([\w:][-\w\d.]*):)?([\w:][-\w\d.]*)/ diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index fb777b1d5..db507f78c 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -53,7 +53,7 @@ require "rss/xml-stylesheet" module RSS - VERSION = "0.1.8" + VERSION = "0.1.9" URI = "http://purl.org/rss/1.0/" |
