Bug #1042
closedRDoc crashes while generating HTML after parsing a Ruby DSL.
Description
=begin
I maintain a SQL/Injection DSL written in Ruby. Recently RDoc began to crash when I would run the usual API documentation generation rake task. The source-code for this DSL, which causes RDoc to crash in the middle of generating HTML documentation, is located here: http://github.com/postmodern/ronin-sql/tree/master.
$ git clone git://github.com/postmodern/ronin-sql.git
$ cd ronin-sql
$ rake19 --trace docs # I configured Ruby 1.9.1-rc2 to with --program-suffix=19
Generating HTML...
Diagrams: ....
rake aborted!
undefined method type' for nil:NilClass /usr/lib/ruby19/1.9.1/rdoc/markup/fragments.rb:299:in
block in add_list_breaks'
/usr/lib/ruby19/1.9.1/rdoc/markup/fragments.rb:290:in each' /usr/lib/ruby19/1.9.1/rdoc/markup/fragments.rb:290:in
add_list_breaks'
/usr/lib/ruby19/1.9.1/rdoc/markup/fragments.rb:164:in normalize' /usr/lib/ruby19/1.9.1/rdoc/markup.rb:354:in
group_lines'
/usr/lib/ruby19/1.9.1/rdoc/markup.rb:145:in convert' /usr/lib/ruby19/1.9.1/rdoc/markup/formatter.rb:10:in
convert'
/usr/lib/ruby19/1.9.1/rdoc/generator.rb:70:in markup' /usr/lib/ruby19/1.9.1/rdoc/generator.rb:728:in
value_hash'
/usr/lib/ruby19/1.9.1/rdoc/generator.rb:775:in write_on' /usr/lib/ruby19/1.9.1/rdoc/generator/html.rb:232:in
block (2 levels) in gen_into'
/usr/lib/ruby19/1.9.1/open-uri.rb:35:in open' /usr/lib/ruby19/1.9.1/open-uri.rb:35:in
open'
/usr/lib/ruby19/1.9.1/rdoc/generator/html.rb:231:in block in gen_into' /usr/lib/ruby19/1.9.1/rdoc/generator/html.rb:216:in
each'
/usr/lib/ruby19/1.9.1/rdoc/generator/html.rb:216:in gen_into' /usr/lib/ruby19/1.9.1/rdoc/generator/html.rb:179:in
generate_html'
/usr/lib/ruby19/1.9.1/rdoc/generator/html.rb:86:in generate' /usr/lib/ruby19/1.9.1/rdoc/rdoc.rb:279:in
document'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake/rdoctask.rb:113:in block in define' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:617:in
call'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:617:in block in execute' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:612:in
each'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:612:in execute' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:578:in
block in invoke_with_call_chain'
/usr/lib/ruby19/1.9.1/monitor.rb:190:in mon_synchronize' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_chain'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:588:in block in invoke_prerequisites' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:585:in
each'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:585:in invoke_prerequisites' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:577:in
block in invoke_with_call_chain'
/usr/lib/ruby19/1.9.1/monitor.rb:190:in mon_synchronize' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_chain'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:564:in invoke' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:2019:in
invoke_task'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:1997:in block (2 levels) in top_level' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:1997:in
each'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:1997:in block in top_level' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exception_handling'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:1991:in top_level' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:1970:in
block in run'
/usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:2036:in standard_exception_handling' /usr/lib/ruby19/gems/1.9.1/gems/rake-0.8.3/lib/rake.rb:1967:in
run'
/usr/bin/rake19:31:in `'
This bug is also present in Ruby 1.8.6 (2008-08-11 patchlevel 287).
=end