From 1606d35cb18cb4ef44f8627ab5f1a67de2a166e9 Mon Sep 17 00:00:00 2001 From: Johannes Wollert Date: Fri, 17 Jan 2014 13:47:04 +0100 Subject: [PATCH] allow our custom register to pass blocks so plugins don't have to rely on the bare-bones Redmine::Plugin --- lib/open_project/plugins/acts_as_op_engine.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/open_project/plugins/acts_as_op_engine.rb b/lib/open_project/plugins/acts_as_op_engine.rb index ea4a9d6edd..30ad3ce1d8 100644 --- a/lib/open_project/plugins/acts_as_op_engine.rb +++ b/lib/open_project/plugins/acts_as_op_engine.rb @@ -70,7 +70,7 @@ module OpenProject::Plugins # options: An options Hash, at least :requires_openproject is recommended to # define the minimal version of OpenProject the plugin is compatible with # Another common option is :author_url. - base.send(:define_method, :register) do |gem_name, options| + base.send(:define_method, :register) do |gem_name, options, &block| base.initializer "#{engine_name}.register_plugin" do spec = Bundler.environment.specs[gem_name][0] @@ -84,7 +84,7 @@ module OpenProject::Plugins options.each do |name, value| send(name, value) end - end + end.instance_eval(&block) end # Workaround to ensure settings are available after unloading in development mode