Commit dfe9d61b59f9ab1210f94c4c8c0611e560dff4a4
1 parent
1cf42fc1
Exists in
master
and in
22 other branches
Remove unecessary Noosfero::Plugin::Context class
It was just a wrapper around controller, with no clear goal. In the end, the context will the object which invokes the plugins. Rigth now it means basically a controller, but wait a little bit and see. ;-)
Showing
3 changed files
with
2 additions
and
18 deletions
Show diff stats
config/initializers/plugins.rb
lib/noosfero/plugin/context.rb
... | ... | @@ -1,15 +0,0 @@ |
1 | -# This class defines the interface to important context information from the | |
2 | -# controller that can be accessed by plugins | |
3 | -class Noosfero::Plugin::Context | |
4 | - | |
5 | - def initialize(controller) | |
6 | - @controller = controller | |
7 | - end | |
8 | - | |
9 | - delegate :profile, :request, :response, :environment, :params, :session, :user, :logged_in?, :to => :controller | |
10 | - | |
11 | - protected | |
12 | - | |
13 | - attr_reader :controller | |
14 | - | |
15 | -end |
lib/noosfero/plugin/manager.rb
... | ... | @@ -3,9 +3,9 @@ class Noosfero::Plugin::Manager |
3 | 3 | attr_reader :environment |
4 | 4 | attr_reader :context |
5 | 5 | |
6 | - def initialize(environment, controller) | |
6 | + def initialize(environment, context) | |
7 | 7 | @environment = environment |
8 | - @context = Noosfero::Plugin::Context.new(controller) | |
8 | + @constantize = context | |
9 | 9 | end |
10 | 10 | |
11 | 11 | delegate :each, :to => :enabled_plugins | ... | ... |