Redmine plugins are usually not Ruby gems but live in a folder inside the main Rails app.
As long as the plugin author follows a few Rails best practices, Rails' autoloading should (and will) also work with Redmine plugins. The basic things to pay attention to are:
- proper naming and namespacing - have subdirectories corresponding to modules and file names corresponding to the class / module they declare, i.e.
Foo::Bar::Baz
lives in lib/foo/bar/baz.rb
- never require stuff manually, but let Rails autoload everything
- be careful when and where you patch things to have patches re-applied during automatic reloading
If a plugin author follows these rules, the plugin's code will most probably autoload and reload just fine. One exception is the plugin's init.rb
, but this usually doesn't change very often during plugin development.
In practice, a lot of Redmine plugins break auto loading due to violation of these rules. Symptoms can be no automatic reloading, or even an application error when reloading is attempted, resulting in an application that works fine in production mode, but fail after the first successful request in development mode.
Often simply re-organizing the plugin code to match Rails' expectations and removing require statements is all it takes to fix this kind of problem.
Changing the routes declared by a plugin will require a restart of the server nevertheless, I do not know of a way to have these reloaded automatically with Redmine.