diff options
Diffstat (limited to 'lib/rubygems/installer_uninstaller_utils.rb')
-rw-r--r-- | lib/rubygems/installer_uninstaller_utils.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rubygems/installer_uninstaller_utils.rb b/lib/rubygems/installer_uninstaller_utils.rb index e81ed4cba3..2c8b7c635e 100644 --- a/lib/rubygems/installer_uninstaller_utils.rb +++ b/lib/rubygems/installer_uninstaller_utils.rb @@ -6,11 +6,16 @@ module Gem::InstallerUninstallerUtils def regenerate_plugins_for(spec, plugins_dir) + plugins = spec.plugins + return if plugins.empty? + + require 'pathname' + spec.plugins.each do |plugin| plugin_script_path = File.join plugins_dir, "#{spec.name}_plugin#{File.extname(plugin)}" File.open plugin_script_path, 'wb' do |file| - file.puts "require '#{plugin}'" + file.puts "require_relative '#{Pathname.new(plugin).relative_path_from(Pathname.new(plugins_dir))}'" end verbose plugin_script_path |