Organizing output class list into sections manually #1573
-
[Edit - simplified to one question since they were similar YARD groups the models under one item in the output class list. But not the lib files. Is there a way to fix this with config or folder/file structures? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
YARD doesn't group based on directory or know about "models" as a concept. The reason you're seeing disconnected trees is because YARD has no context for the "Driver" code object in your hierarchy. Based on layout you've described, there is no file that defines Defining module Vehicle
module Driver
class Assign
# code here
end
end
end Now you will get the correct tree: |
Beta Was this translation helpful? Give feedback.
YARD doesn't group based on directory or know about "models" as a concept. The reason you're seeing disconnected trees is because YARD has no context for the "Driver" code object in your hierarchy.
Based on layout you've described, there is no file that defines
Driver
as either a module or a class, and because it's undefined in your source, YARD treats it as an external class. As an external class, it is not generated as an expandable field.Defining
Vehicle::Driver
as a module somewhere-- anywhere-- in your source should resolve this. Avoiding the shorthand class reopening syntax (see Rubocop's Style/ClassAndModuleChildren rule) would be an easy way to do this. Inlib/vehicle/driver/assi…