Feature #14030

Allow plugins to put gems inside PluginGemfile

Added by Harry Garrood about 5 years ago. Updated almost 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Baptiste Barth% Done:

0%

Category:Plugin API
Target version:2.6.0
Resolution:Fixed

Description

Having plugins put their gem requirements in Gemfile means that doing anything which involves Bundler inside the plugin directory (eg rake redmine:plugins:test) breaks.

Could Redmine's own Gemfile be changed so that it looks for files names, say, PluginGemfile as well?

Associated revisions

Revision 13337
Added by Jean-Baptiste Barth almost 4 years ago

Add ability to define plugins' gem dependencies in PluginGemfile (#14030).

History

#1 Updated by Harry Garrood about 5 years ago

To clarify -- Bundler sees a Gemfile in the current directory (/path/to/redmine/plugins/redmine_foo), and assumes that it is the root of the project, which is not the case.

#2 Updated by Jean-Baptiste Barth about 5 years ago

  • Assignee set to Jean-Baptiste Barth

Obviously you shouldn't run redmine rake tasks directly inside plugins. Bundler is not broken inside plugins per se. As plugins cannot run without redmine core, commands should be run from redmine core and optionnally limit effects to a specific plugin (with NAME=redmine_foo for instance).

Renaming things in a non-standard fashion would break plugins possible integration as rubygems which is not better I think.

#3 Updated by Harry Garrood about 5 years ago

At the moment you shouldn't, but it would certainly be nice (and be less confusing for plugin authors) to be able to.

I don't see how it would break possible integration with rubygems -- it certainly wouldn't be the first gemfile to not be called Gemfile:

#4 Updated by Jean-Baptiste Barth about 5 years ago

Yes, you're right, I spoke too soon. Only gemspec is required for rubygems integration, some gems don't even have a Gemfile and it works well.

I'd love to hear Jean-Philippe thoughts on this point.

#5 Updated by Jean-Philippe Lang about 5 years ago

OK for loading PluginGemfile. Gemfile should still be loaded if it exists for compatibility.

#6 Updated by Robin Böning over 4 years ago

I think this Issue can be closed, since the Gemfile also loads Gemfiles of plugins, right?

#7 Updated by Jean-Baptiste Barth almost 4 years ago

  • Status changed from New to Closed
  • Target version set to 2.6.0
  • Resolution set to Fixed

@Robin: not really, the requested feature is actually to be able to avoid the "Gemfile" file which has a specific meaning for bundler, so you could run bundler commands inside plugins without having bundler cry.

The feature was added in r13337.

Also available in: Atom PDF