Skip to content

Conversation

@alindeman
Copy link
Contributor

Given a file class_alias.rb:

module Test
  class Foo
  end
end

Foo = Test::Foo

Running rdoc -C class_alias.rb will bomb with this stack trace:

undefined method `full_name' for nil:NilClass
/home/andy/workspace/rdoc/lib/rdoc/stats.rb:219:in `report'
    /home/andy/workspace/rdoc/lib/rdoc/context.rb:651:in `each_constant'
    /home/andy/workspace/rdoc/lib/rdoc/context.rb:651:in `each'
    /home/andy/workspace/rdoc/lib/rdoc/context.rb:651:in `each_constant'
    /home/andy/workspace/rdoc/lib/rdoc/stats.rb:217:in `report'
    /home/andy/workspace/rdoc/lib/rdoc/stats.rb:182:in `each'
    /home/andy/workspace/rdoc/lib/rdoc/stats.rb:182:in `report'
    /home/andy/workspace/rdoc/lib/rdoc/rdoc.rb:421:in `document'
    bin/rdoc:15

My commit will ignore undocumented class/modules aliases in the report printing routine. The original class is the only one that needs to appear in the report.

@drbrain
Copy link
Member

drbrain commented Dec 25, 2010

Applied.

I also wrote a test and added some TODOs for the appearance of constant aliases in the summary and report. Since they're usually a tool of programmer convenience I don't think they should be counted against the documentation summary.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants