You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running yard doc generates static output just fine. It also generates the .yardoc/ db containing a marshalled reference to my custom code object. If I keep this db around and run yard server, the server barfs.
$ yard docFiles: 1Modules: 1 ( 1 undocumented)Classes: 0 ( 0 undocumented)Constants: 0 ( 0 undocumented)Attributes: 0 ( 0 undocumented)Methods: 0 ( 0 undocumented) 0.00% documented
$ yard server>> YARD 0.9.25 documentation server at http://localhost:8808Puma starting in single mode...* Version 3.12.2 (ruby 2.5.1-p57), codename: Llamas in Pajamas* Min threads: 0, max threads: 16* Environment: development* Listening on tcp://0.0.0.0:8808Use Ctrl-C to stop
Swapping those two lines so that the .yardopts are setup first (thereby loading my custom code) fixes the issue.
diff --git a/lib/yard/server/commands/library_command.rb b/lib/yard/server/commands/library_command.rb
index 34b84d89..2ac244b7 100644
--- a/lib/yard/server/commands/library_command.rb+++ b/lib/yard/server/commands/library_command.rb@@ -122,8 +122,8 @@ module YARD
def setup_library
library.prepare! if request.xhr? && request.query['process']
- load_yardoc
setup_yardopts
+ load_yardoc
true
end
Any reason these steps shouldn't go in this order? Or am I missing something about how I'm supposed to load custom code?
FWIW, without the above patch, I can still force the custom code to load first by explicitly saying yard server -e custom.rb. Then loading the registry works fine and the server doesn't crash. I would of course like the yardopts to take care of it, though.
The text was updated successfully, but these errors were encountered:
I have a custom code object and a handler that adds it to the YARD registry. I'm using
.yardopts
to pass the-e
flag pointing at this custom code..yardopts
issue.rb
custom.rb
Running
yard doc
generates static output just fine. It also generates the.yardoc/
db containing a marshalled reference to my custom code object. If I keep this db around and runyard server
, the server barfs.This appears to be because YARD is loading the registry before the
.yardopts
.yard/lib/yard/server/commands/library_command.rb
Lines 123 to 128 in ca59056
Swapping those two lines so that the
.yardopts
are setup first (thereby loading my custom code) fixes the issue.Any reason these steps shouldn't go in this order? Or am I missing something about how I'm supposed to load custom code?
FWIW, without the above patch, I can still force the custom code to load first by explicitly saying
yard server -e custom.rb
. Then loading the registry works fine and the server doesn't crash. I would of course like the yardopts to take care of it, though.The text was updated successfully, but these errors were encountered: