lsegal / yard

YARD is a Ruby Documentation tool. The Y stands for "Yay!"
http://yardoc.org
MIT License
1.94k stars 397 forks source link

v0.9.1 NamespaceObjects defined on objects included via 'require' #985

Closed MSP-Greg closed 8 years ago

MSP-Greg commented 8 years ago

I normally doc YARD with --private, and prior to 0.9.1 I didn't see any errors. Now I'm seeing errors with Rack and WEBrick. You might have a look, I can't get to it until tomorrow. YARD does recover fine from the error.

FYI, I did notice that I had (in error) excluded them from the 'Class List' generated by yard-t2. I've never noticed issues (after all parsing) with proxies, but I forgot about 'require' namespace objects...

lsegal commented 8 years ago

Can you provide a reproduction case for this?

MSP-Greg commented 8 years ago

First, just digging around and noticed YARD::CodeObjects::NamespaceMapper. RTFM.

As to the repro, run YARD thru YARD with --private. I'm pretty sure I didn't see errors with either 0.8.7.6 or 0.9.0.

lsegal commented 8 years ago

I don't see any errors. Can you please follow the bug report instructions in the Contributing Guide to provide more relevant information (debug output, versions, expected output, etc)?

MSP-Greg commented 8 years ago

YARD Version 0.9.1

WEBrick::HTTPRequest is listed in the 'Class List' as:

WEBrick::HTTPRequest < Object

listed on the index page as:

HTTPRequest (WEBrick)

no html file is created for the object by YARD. Same situation with WEBrick::HTTPRequest.

Below is debug / log output --

D:\GitHub\yard>yardoc --yardopt D:/repros/Yard.yo

[warn]: In file `lib/yard/config.rb':3: Cannot resolve link to #arguments from text:
[warn]: ...{#arguments}...
[warn]: In file `lib/yard/config.rb':3: Cannot resolve link to #arguments from text:
[warn]: ...{#arguments}...
[warn]: In file `lib/yard/config.rb':195: Cannot resolve link to #arguments from text:
[warn]: ...{#arguments}...
[warn]: In file `lib/yard/config.rb':205: Cannot resolve link to #arguments from text:
[warn]: ...{#arguments}...
[warn]: In file `lib/yard/docstring_parser.rb':5: Cannot resolve link to Directive#after_parse from text:
[warn]: ...{Directive#after_parse}...
[warn]: In file `lib/yard/docstring_parser.rb':272: Cannot resolve link to Directive#after_parse from text:
[warn]: ...{Directive#after_parse}...

[warn]: Load Order / Name Resolution Problem on Rack:
[warn]: -
[warn]: Something is trying to call inheritance_tree on object Rack before it has been recognized.
[warn]: This error usually means that you need to modify the order in which you parse files
[warn]: so that Rack is parsed before methods or other objects attempt to access it.
[warn]: -
[warn]: YARD will recover from this error and continue to parse but you *may* have problems
[warn]: with your generated documentation. You should probably fix this.
[warn]: -
[error]: Exception occurred while generating 'Rack/Request.html'
[error]: ProxyMethodError: Proxy cannot call method #inheritance_tree on object 'Rack'
[error]: Stack trace:
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/code_objects/proxy.rb:208:in `rescue in method_missing'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/code_objects/proxy.rb:205:in `method_missing'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/registry_resolver.rb:160:in `collect_namespaces'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/registry_resolver.rb:122:in `block in lookup_path_inherited'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/registry_resolver.rb:113:in `each'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/registry_resolver.rb:113:in `lookup_path_inherited'

[warn]: Load Order / Name Resolution Problem on WEBrick:
[warn]: -
[warn]: Something is trying to call inheritance_tree on object WEBrick before it has been recognized.
[warn]: This error usually means that you need to modify the order in which you parse files
[warn]: so that WEBrick is parsed before methods or other objects attempt to access it.
[warn]: -
[warn]: YARD will recover from this error and continue to parse but you *may* have problems
[warn]: with your generated documentation. You should probably fix this.
[warn]: -
[error]: Exception occurred while generating 'WEBrick/HTTPRequest.html'
[error]: ProxyMethodError: Proxy cannot call method #inheritance_tree on object 'WEBrick'
[error]: Stack trace:
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/code_objects/proxy.rb:208:in `rescue in method_missing'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/code_objects/proxy.rb:205:in `method_missing'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/registry_resolver.rb:160:in `collect_namespaces'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/registry_resolver.rb:122:in `block in lookup_path_inherited'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/registry_resolver.rb:113:in `each'
        C:/Ruby23/lib/ruby/gems/2.3.0/gems/yard-0.9.0/lib/yard/registry_resolver.rb:113:in `lookup_path_inherited'

Files:         178
Modules:        44 (    5 undocumented)
Classes:       208 (   44 undocumented)
Constants:      93 (   33 undocumented)
Attributes:    191 (    0 undocumented)
Methods:      1301 (  247 undocumented)
 82.09% documented

D:\GitHub\yard>pause
Press any key to continue . . .
lsegal commented 8 years ago

What's in the --yardopts file you are using? D:/repros/Yard.yo

MSP-Greg commented 8 years ago

--private, as I stated earlier...

--private
--output-dir D:/docs_yardoc/yard
--title YARD

--protected
--embed-mixin ClassMethods
--exclude /server/templates/
--exclude /yard/rubygems/
--asset docs/images:images
--tag yard.signature:"YARD Tag Signature"
--type-name-tag yard.tag:"YARD Tag"
--type-name-tag yard.directive:"YARD Directive"
--hide-tag yard.tag
--hide-tag yard.directive
--hide-tag yard.signature
--load ./docs/templates/plugin.rb
-
CHANGELOG.md
docs/WhatsNew.md
docs/GettingStarted.md
docs/Tags.md
docs/Overview.md
docs/CodeObjects.md
docs/Parser.md
docs/Handlers.md
docs/TagsArch.md
docs/Templates.md
LICENSE
LEGAL
lsegal commented 8 years ago

Thanks for the complete info, I was able to reproduce and fix!