From: Hugh Sasse Staff Elec Eng Date: 2004-03-12T01:46:06+09:00 Subject: Problems rdoc'ing cvs... I have just done cvs update -d both for rdoc and for my ruby cvs directory. Running rdoc on the results gave: [...] beginmainend.rb: test_beginendblock.rb: c.... test_trackback.rb: c.... test_syndication.rb: c.c RDoc failure in test/rss/test_syndication.rb at or around line 22 column 37 Before reporting this, could you check that the file you're documenting compiles cleanly--RDoc is not a full Ruby parser, and gets confused easily if fed invalid programs. The internal error was: /usr/local/lib/ruby/site_ruby/1.8/rdoc/parsers/parse_rb.rb:2287:in `get_symbol_or_name': Name or symbol expected (got #) (RuntimeError) from /usr/local/lib/ruby/site_ruby/1.8/rdoc/parsers/parse_rb.rb:2293:in `parse_alias' from /usr/local/lib/ruby/site_ruby/1.8/rdoc/parsers/parse_rb.rb:1679:in `parse_statements' from /usr/local/lib/ruby/site_ruby/1.8/rdoc/parsers/parse_rb.rb:1753:in `parse_class' brains hgs 63 %> The file looks like: brains hgs 72 %> cat -n test/rss/test_syndication.rb | body 30 36 30 31 @sy_nodes = @elems.collect do |name, value| 32 "<#{@prefix}:#{name}>#{CGI.escapeHTML(value.to_s)}" 33 end.join("\n") 34 35 @rss_source = make_RDF(<<-EOR, {@prefix => @uri}) 36 #{make_channel(@sy_nodes)} brains hgs 73 %> I then get an error at line 22, then 70. These seemed to relate to alias_method(:this,:that). Removing the brackets helped. I did this for test_dublincore.rb also and it was happier. I don't know if this is something that should be changed in rdoc, or if it is actually preferred to avoid the brackets (as this has not shown up in the other files), but my patch, for what it is worth, is below. Something seems to have happened to the spacing where I changed end to }. Hugh --- ./ruby/test/rss/test_syndication.rb.orig 2004-02-26 13:42:34.958102000 +0000 +++ ./ruby/test/rss/test_syndication.rb 2004-03-11 16:27:18.859748000 +0000 @@ -19,7 +19,7 @@ t = Time.iso8601("2000-01-01T12:00:05+00:00") class << t - alias_method(:to_s, :iso8601) + alias_method :to_s, :iso8601 end @elems = { @@ -28,9 +28,9 @@ :updateBase => t, } - @sy_nodes = @elems.collect do |name, value| + @sy_nodes = @elems.collect { |name, value| "<#{@prefix}:#{name}>#{CGI.escapeHTML(value.to_s)}" - end.join("\n") + }.join("\n") @rss_source = make_RDF(<<-EOR, {@prefix => @uri}) #{make_channel(@sy_nodes)} @@ -65,7 +65,7 @@ t = Time.iso8601("2003-01-01T12:00:23+09:00") class << t - alias_method(:to_s, :iso8601) + alias_method :to_s, :iso8601 end new_value = { --- ./ruby/test/rss/test_dublincore.rb.orig 2004-02-26 13:42:34.854453000 +0000 +++ ./ruby/test/rss/test_dublincore.rb 2004-03-11 16:31:51.302868000 +0000 @@ -19,7 +19,7 @@ t = Time.iso8601("2000-01-01T12:00:05+00:00") class << t - alias_method(:to_s, :iso8601) + alias_method :to_s, :iso8601 end @elems = { @@ -88,7 +88,7 @@ if name == :date t = Time.iso8601("2003-01-01T02:30:23+09:00") class << t - alias_method(:to_s, :iso8601) + alias_method :to_s, :iso8601 end @rss.send(parent).send("dc_#{name}=", t.iso8601) assert_equal(t, @rss.send(parent).send("dc_#{name}"))