Defect #14028

Plugins Gemfiles loading breaks __FILE__

Added by Jean-Baptiste Barth over 4 years ago. Updated over 4 years ago.

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

0%

Category:Plugin API
Target version:2.4.0
Resolution:Fixed Affected version:

Description

When loading Gemfile inside plugins, Redmine simply does an instance_eval call. This breaks __FILE__ inside loaded files because the filename is not provided (it's set to (eval) actually). This breaks the ability to provide a gemspec, and it may break other features of bundler that relies on current path. The gemspec directive won't work out of the box with the filename provided, but at least it will be possible to manually provide an option to the current directory of the gemspec.

Bundler now provides a eval_gemfile directive in its DSL that would be safer overall, but it's only here since 1.2.0, and we don't enforce such restriction for now (only restriction on bundler version is imposed by rails, requiring ~> 1.0).

Associated revisions

Revision 11826
Added by Jean-Baptiste Barth over 4 years ago

Improve plugins' Gemfile loading (#14028).

History

#1 Updated by Jean-Baptiste Barth over 4 years ago

  • Status changed from Confirmed to Closed
  • Target version set to 2.4.0
  • Resolution set to Fixed

Fixed in r11826.

Also available in: Atom PDF