Skip to content

Conversation

@prahal
Copy link

@prahal prahal commented Apr 20, 2022

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.

I also add plugin lib to the LOAD_PATH.

rgaida added a commit to rgaida/redmine_git_hosting that referenced this pull request Aug 3, 2022
@dosyfier dosyfier mentioned this pull request Sep 10, 2022
@PowerKiKi
Copy link
Collaborator

Thank you for your work so far. It has been superseded by #815

@PowerKiKi PowerKiKi closed this Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants