Commit dc71530448f525434b58603319a673fa121f5d5d

Authored by Joenio Costa
1 parent a8796aa1

Revert "Avoiding plugins to be loaded during rake"

This reverts commit becdcf37421d9c9cd24e4c87ec4b2027867c722d.
Showing 2 changed files with 0 additions and 39 deletions   Show diff stats
lib/tasks/env.rake
1   -enabled_plugins = Dir.glob(File.join(Rails.root, 'config', 'plugins', '*')).map {|path| File.basename(path)}.reject {|a| a == "README"}
2   -sh './script/noosfero-plugins disableall'
3 1 require File.join(File.dirname(__FILE__), '../../config/environment.rb')
4   -enabled_plugins.each do |plugin|
5   - sh "./script/noosfero-plugins enable #{plugin}"
6   -end
... ...
lib/tasks/plugins.rake
... ... @@ -8,39 +8,6 @@ namespace :noosfero do
8 8 ActiveRecord::Migrator.migrate(path, ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
9 9 end
10 10 end
11   -
12   - task :save_enabled do
13   - ENV['ENABLED_PLUGINS'] = Dir.glob(File.join(Rails.root, 'config', 'plugins', '*')).map {|path| File.basename(path)}.reject {|a| a == "README"}.join(',')
14   - end
15   -
16   - task :temporary_config, :action, :needs => [:save_enabled] do |t, args|
17   - sh "./script/noosfero-plugins #{args.action}all"
18   - end
19   -
20   - task :restore_config do
21   - sh "./script/noosfero-plugins disableall"
22   - enabled_plugins = ENV['ENABLED_PLUGINS'].split(',')
23   - enabled_plugins.each do |plugin|
24   - sh "./script/noosfero-plugins enable #{plugin}"
25   - end
26   - end
27   -
28   - task :prepare_environment_disable do
29   - Rake::Task['noosfero:plugins:temporary_config'].invoke('disable')
30   -
31   - Rake::Task['environment'].enhance do
32   - Rake::Task['noosfero:plugins:restore_config'].invoke
33   - end
34   - end
35   -
36   - task :prepare_environment_enable do
37   - Rake::Task['noosfero:plugins:temporary_config'].invoke('enable')
38   -
39   - Rake::Task['environment'].enhance do
40   - Rake::Task['noosfero:plugins:restore_config'].invoke
41   - end
42   - end
43   -
44 11 task :abort_if_pending_migrations do
45 12 if defined? ActiveRecord
46 13 plugin_migration_dirs.each do |path|
... ... @@ -61,4 +28,3 @@ end
61 28  
62 29 task 'db:migrate' => 'noosfero:plugins:migrate'
63 30 task 'db:abort_if_pending_migrations' => 'noosfero:plugins:abort_if_pending_migrations'
64   -task 'environment' => 'noosfero:plugins:prepare_environment_disable'
... ...