From: Hugh Sasse Date: 2006-07-13T02:50:53+09:00 Subject: rss patch -- mostly doc, plus English adjustments. This is a patch set against the stable snapshot. -rw-r--r-- 1 hgs staff 4467555 Jul 12 16:27 stable-snapshot.tar.gz md5sum: afbd1bc2f78ddc6fdb15d07adb77c31a stable-snapshot.tar.gz I've tried to improve the error messages, and add comments to the code where I can. I'm not 100% certain how plurals are used in the dublincore code: in particular if they need to be distinct words from the single form (an assumption not always true in English (1 sheep, many sheep, similarly for deer...)). Obviously more needs doing to RSS in terms of rdoc docs but if this gets under the wire for 1.8.5 final it would be a start. HTH, Hugh --- ./lib/rss/parser.rb.orig 2006-06-18 16:06:55.000000000 +0100 +++ ./lib/rss/parser.rb 2006-07-12 17:43:44.382577000 +0100 @@ -21,15 +21,16 @@ class XMLParserNotFound < Error def initialize - super("available XML parser does not found in " << + super("available XML parser was not found in " << "#{AVAILABLE_PARSER_LIBRARIES.inspect}.") end end class NotValidXMLParser < Error def initialize(parser) - super("#{parser} is not available XML parser. " << - "available XML parser is " << + super("#{parser} is not an available XML parser. " << + "Available XML parser"<< + (AVAILABLE_PARSERS.size > 1 ? "s are ": " is ") << "#{AVAILABLE_PARSERS.inspect}.") end end @@ -55,6 +56,8 @@ @@default_parser || AVAILABLE_PARSERS.first end + # Set @@default_parser to new_value if it is one of the + # available parsers. Else raise NotValidXMLParser error. def default_parser=(new_value) if AVAILABLE_PARSERS.include?(new_value) @@default_parser = new_value @@ -96,10 +99,13 @@ end end + # maybe_xml? tests if source is a string that looks like XML. def maybe_xml?(source) source.is_a?(String) and / nil, "relation" => nil, "coverage" => nil, - "rights" => "rightses" # FIXME + "rights" => "rights" # this refers to a set of management rights + # If you add more rights it remains plural. + # I can't see anywhere that these names must be + # distinct. "deer" => "deer" etc. } DATE_ELEMENTS = {