From 3e99a558261678f01c6d69b6053d4394adbea68b Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Tue, 31 Mar 2015 21:23:01 -0300 Subject: [PATCH] Revert "plugins: revert change on pipeline" --- lib/noosfero/plugin/manager.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/noosfero/plugin/manager.rb b/lib/noosfero/plugin/manager.rb index 479eb27..2315d33 100644 --- a/lib/noosfero/plugin/manager.rb +++ b/lib/noosfero/plugin/manager.rb @@ -24,7 +24,7 @@ class Noosfero::Plugin::Manager end def fetch_plugins(event, *args) - flat_map{ |plugin| plugin.class if result_for plugin, event, *args }.compact + map { |plugin| plugin.class if result_for plugin, event, *args }.compact.flatten end def dispatch_without_flatten(event, *args) @@ -60,8 +60,7 @@ class Noosfero::Plugin::Manager def pipeline(event, *args) each do |plugin| - # result_for can't be used here and default must be returned to keep args - result = plugin.send event, *args + result = result_for plugin, event, *args result = result.kind_of?(Array) ? result : [result] raise ArgumentError, "Pipeline broken by #{plugin.class.name} on #{event} with #{result.length} arguments instead of #{args.length}." if result.length != args.length args = result -- libgit2 0.21.2