Skip to content

Commit

Permalink
Group code object files into the same directory (#1114)
Browse files Browse the repository at this point in the history
It's hard to distinguish code object classes by their file names alone.
And given that we have 18 such classes, it'd make the codebase a lot
easier to understand if we grouped them into a single directory.

Given that these classes are all autoloaded in `lib/rdoc.rb` instead
of required individually, this change should have minimum impact on
projects using RDoc as they generally just require `rdoc`, not individual
files. An example is Rails' `sdoc`:
https://github.com/rails/sdoc/blob/main/lib/sdoc/rdoc_monkey_patches.rb
  • Loading branch information
st0012 authored Jul 2, 2024
1 parent 061cd1a commit 4211292
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions lib/rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,26 +188,26 @@ def self.home
# programs: classes, modules, methods, and so on.
autoload :CodeObject, "#{__dir__}/rdoc/code_object"

autoload :Context, "#{__dir__}/rdoc/context"
autoload :TopLevel, "#{__dir__}/rdoc/top_level"

autoload :AnonClass, "#{__dir__}/rdoc/anon_class"
autoload :ClassModule, "#{__dir__}/rdoc/class_module"
autoload :NormalClass, "#{__dir__}/rdoc/normal_class"
autoload :NormalModule, "#{__dir__}/rdoc/normal_module"
autoload :SingleClass, "#{__dir__}/rdoc/single_class"

autoload :Alias, "#{__dir__}/rdoc/alias"
autoload :AnyMethod, "#{__dir__}/rdoc/any_method"
autoload :MethodAttr, "#{__dir__}/rdoc/method_attr"
autoload :GhostMethod, "#{__dir__}/rdoc/ghost_method"
autoload :MetaMethod, "#{__dir__}/rdoc/meta_method"
autoload :Attr, "#{__dir__}/rdoc/attr"

autoload :Constant, "#{__dir__}/rdoc/constant"
autoload :Mixin, "#{__dir__}/rdoc/mixin"
autoload :Include, "#{__dir__}/rdoc/include"
autoload :Extend, "#{__dir__}/rdoc/extend"
autoload :Require, "#{__dir__}/rdoc/require"
autoload :Context, "#{__dir__}/rdoc/code_object/context"
autoload :TopLevel, "#{__dir__}/rdoc/code_object/top_level"

autoload :AnonClass, "#{__dir__}/rdoc/code_object/anon_class"
autoload :ClassModule, "#{__dir__}/rdoc/code_object/class_module"
autoload :NormalClass, "#{__dir__}/rdoc/code_object/normal_class"
autoload :NormalModule, "#{__dir__}/rdoc/code_object/normal_module"
autoload :SingleClass, "#{__dir__}/rdoc/code_object/single_class"

autoload :Alias, "#{__dir__}/rdoc/code_object/alias"
autoload :AnyMethod, "#{__dir__}/rdoc/code_object/any_method"
autoload :MethodAttr, "#{__dir__}/rdoc/code_object/method_attr"
autoload :GhostMethod, "#{__dir__}/rdoc/code_object/ghost_method"
autoload :MetaMethod, "#{__dir__}/rdoc/code_object/meta_method"
autoload :Attr, "#{__dir__}/rdoc/code_object/attr"

autoload :Constant, "#{__dir__}/rdoc/code_object/constant"
autoload :Mixin, "#{__dir__}/rdoc/code_object/mixin"
autoload :Include, "#{__dir__}/rdoc/code_object/include"
autoload :Extend, "#{__dir__}/rdoc/code_object/extend"
autoload :Require, "#{__dir__}/rdoc/code_object/require"

end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4211292

Please sign in to comment.