Skip to content

A platform for community discussion. Free, open, simple.

DEV: Don't install plugin gems twice (#16192)

Jarek Radoszdec68d780c58
diff --git a/lib/tasks/plugin.rake b/lib/tasks/plugin.rake
index 8c31bbe0f80..ea97745b166 100644
--- a/lib/tasks/plugin.rake
+++ b/lib/tasks/plugin.rake
@@ -127,7 +127,6 @@ end
desc 'pull a compatible plugin version'
task 'plugin:pull_compatible', :plugin do |t, args|
-
plugin = ENV['PLUGIN'] || ENV['plugin'] || args[:plugin]
plugin_path = plugin
plugin = File.basename(plugin)
@@ -154,26 +153,18 @@ end
desc 'install all plugin gems'
task 'plugin:install_all_gems' do |t|
- plugins = Dir.glob(File.expand_path('plugins/*')).select { |f| File.directory? f }
- plugins.each do |plugin|
- Rake::Task['plugin:install_gems'].invoke(plugin)
- Rake::Task['plugin:install_gems'].reenable
- end
+ # Left intentionally blank.
+ # When the app is being loaded, all missing gems are installed
+ # See: lib/plugin_gem.rb
+ puts "Done"
end
desc 'install plugin gems'
task 'plugin:install_gems', :plugin do |t, args|
- plugin = ENV['PLUGIN'] || ENV['plugin'] || args[:plugin]
- plugin_path = plugin + "/plugin.rb"
-
- if File.file?(plugin_path)
- File.open(plugin_path).each do |l|
- next if !l.start_with? "gem"
- next unless /gem\s['"](.*)['"],\s['"](.*)['"]/.match(l)
- puts "gem install #{$1} -v #{$2} -i #{plugin}/gems/#{RUBY_VERSION} --no-document --ignore-dependencies --no-user-install"
- system("gem install #{$1} -v #{$2} -i #{plugin}/gems/#{RUBY_VERSION} --no-document --ignore-dependencies --no-user-install")
- end
- end
+ # Left intentionally blank.
+ # When the app is being loaded, all missing gems are installed
+ # See: lib/plugin_gem.rb
+ puts "Done"
end
desc 'run plugin specs'