Commit 2aed0d5efd2aa0a91fc10611180fc0f51599e7c1
1 parent
181fc268
Exists in
master
and in
29 other branches
Load init in a separate loop
As paths needs to be added to activesupport and ruby, init can't be load at the same time. So do it on a separate loop
Showing
1 changed file
with
6 additions
and
4 deletions
Show diff stats
lib/noosfero/plugin.rb
... | ... | @@ -62,10 +62,12 @@ class Noosfero::Plugin |
62 | 62 | path << File.join(dir, 'lib') |
63 | 63 | # load vendor/plugins |
64 | 64 | Dir.glob(File.join(dir, '/vendor/plugins/*')).each do |vendor_plugin| |
65 | - path << "#{vendor_plugin}/lib" | |
66 | - init = "#{vendor_plugin}/init.rb" | |
67 | - require init.gsub(/.rb$/, '') if File.file? init | |
68 | - end | |
65 | + path << "#{vendor_plugin}/lib" | |
66 | + end | |
67 | + end | |
68 | + Dir.glob(File.join(dir, '/vendor/plugins/*')).each do |vendor_plugin| | |
69 | + init = "#{vendor_plugin}/init.rb" | |
70 | + require init.gsub(/.rb$/, '') if File.file? init | |
69 | 71 | end |
70 | 72 | |
71 | 73 | # add view path | ... | ... |