Sha256: 909c6c2fbea9bc4d79e501275ad2e3c67da5192a46a36c2ff749b747cbdb6d4d

Contents?: true

Size: 773 Bytes

Versions: 32

Compression:

Stored size: 773 Bytes

Contents

# frozen_string_literal: true

##
# Helper methods for both Gem::Installer and Gem::Uninstaller

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_relative '#{Pathname.new(plugin).relative_path_from(Pathname.new(plugins_dir))}'"
      end

      verbose plugin_script_path
    end
  end

  def remove_plugins_for(spec, plugins_dir)
    FileUtils.rm_f Gem::Util.glob_files_in_dir("#{spec.name}#{Gem.plugin_suffix_pattern}", plugins_dir)
  end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
rubygems-update-3.3.27 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.22 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.21 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.20 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.19 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.18 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.17 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.16 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.15 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.14 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.13 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.12 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.11 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.10 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.9 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.8 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.7 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.6 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.5 lib/rubygems/installer_uninstaller_utils.rb
rubygems-update-3.4.4 lib/rubygems/installer_uninstaller_utils.rb