This is to cope with rails autoloading : zeitwerk. I was unable to keep hrack subfolders as is per zeitweirk ended up trying to load Hrack::Lib::Hrack::Lib for the plugin config/routes.rb call to mount Hrack::Bundle.new({}), at: 'githooks/post-receive/:type/:projectid', via: [:post] . Probably a bug in zeitwerk when the a folder has its own name in one of its subfolder.
/var/log/redmine/default/unicorn.stdout.log
An error occurred while loading the routes definition of redmine_git_hosting plugin (/usr/share/redmine/plugins/redmine_git_hosting/config/routes.rb): uninitialized constant Hrack::Lib::Hrack::Lib
Did you mean? Zlib.
If I rename one of the subfolder and the caller Hrack by Hracp it works. So my above deduction.
Otherwise I mostly synchronize the module hierarchy to the folder hierarchy per zeitwerk requirements. I keep the code out of the module if it was not already enclosed by a module.
This is to cope with rails autoloading : zeitwerk. I was unable to keep hrack subfolders as is per zeitweirk ended up trying to load Hrack::Lib::Hrack::Lib for the plugin config/routes.rb call to
mount Hrack::Bundle.new({}), at: 'githooks/post-receive/:type/:projectid', via: [:post]
. Probably a bug in zeitwerk when the a folder has its own name in one of its subfolder.If I rename one of the subfolder and the caller Hrack by Hracp it works. So my above deduction.
Otherwise I mostly synchronize the module hierarchy to the folder hierarchy per zeitwerk requirements. I keep the code out of the module if it was not already enclosed by a module.
I also add plugin lib to the LOAD_PATH.