ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
Refactor lib/redmine/menu_manager.rb to increase extensibility (Feature #269)
Currently, the source:lib/redmine/menu_manager.rb is a rather large file containing multiple inner classes and modules of MenuManager as well as patches for rubytree. Concerning Rails' reloading mechanisms, this ties all these things into one big clump.
I was trying to extend the
Redmine::MenuManager::MenuHelper from within a plugin, but was repetitively running into reloading issues.
At first the repeated loading of file:lib/redmine/menu_manager.rb patching of the rubytree gem resulted in stack level to deep errors (see #266). To cut a long story short. The only way to fix my problem, is to extract all building blocks of the MenuManager into separate files, to allow reloading them on every request during development.
I am therefore proposing to refactor the menu_manager.rb into separate files and, while we're at it, remove the monkey patching of rubytree.
The pull request is sitting at https://github.com/chiliproject/chiliproject/pull/19.
- Assignee deleted (
- Status changed from Open to Ready for review
Eric Davis wrote:
Your pull request removed the bundled gem without adding it's requirement back in anywhere (e.g. no
config.gem line is in
config/environment.rb ever since. Therefor there was no need to add it.
I think removing the bundled gem should be separate from splitting the classes.
I totally agree with that. I was a bit over-the-top with that one. Sorry for that. I've edited the request accordingly.
Thanks for taking the time and giving the feedback.
Gregor Schmidt wrote:
config.gemline is in
config/environment.rbever since. Therefor there was no need to add it.
My mistake, sorry. I forget that
vendor/gems aren't autoloaded like plugins.
I've merged your changes into unstable. I like what you did and would like to see more of
lib/ split like that.
- Target version set to 2.0.0
- Assignee set to Eric Davis
- Category set to Refactoring
- Status changed from Ready for review to Closed
For future reference, if anybody happens to come here using search or something:
The gem line in config/environment.rb which defines the dependency to rubytree is not specific enough. It should be something like
config.gem 'rubytree', :lib => 'tree', :version => '~> 0.5.2'