Bug #986
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
$ rake --trace docs
...
Generating HTML...
/usr/lib/ruby/1.8/rdoc/markup/simple_markup/fragments.rb:291: warning: Object#type is deprecated; use Object#class
rake aborted!
undefined method level' for nil:NilClass /usr/lib/ruby/1.8/rdoc/markup/simple_markup/fragments.rb:292:in
add_list_breaks'
/usr/lib/ruby/1.8/rdoc/markup/simple_markup/fragments.rb:282:in each' /usr/lib/ruby/1.8/rdoc/markup/simple_markup/fragments.rb:282:in
add_list_breaks'
/usr/lib/ruby/1.8/rdoc/markup/simple_markup/fragments.rb:153:in normalize' /usr/lib/ruby/1.8/rdoc/markup/simple_markup.rb:459:in
group_lines'
/usr/lib/ruby/1.8/rdoc/markup/simple_markup.rb:255:in convert' /usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:246:in
markup'
/usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:818:in value_hash' /usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:865:in
write_on'
/usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:1293:in gen_into' /usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:1293:in
open'
/usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:1293:in gen_into' /usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:1289:in
each'
/usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:1289:in gen_into' /usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:1276:in
generate_html'
/usr/lib/ruby/1.8/rdoc/generators/html_generator.rb:1197:in generate' /usr/lib/ruby/1.8/rdoc/rdoc.rb:284:in
document'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rdoctask.rb:113:in define' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in
call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in
each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in
invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in
each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in
invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in
invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in
run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in
run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
=end