Helper methods for both Gem::Installer
and Gem::Uninstaller
Instance Methods
lib/rubygems/installer_uninstaller_utils.rb
View on GitHub
# File tmp/rubies/ruby-3.0.5/lib/rubygems/installer_uninstaller_utils.rb, line 8
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
No documentation available
lib/rubygems/installer_uninstaller_utils.rb
View on GitHub
# File tmp/rubies/ruby-3.0.5/lib/rubygems/installer_uninstaller_utils.rb, line 25
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
No documentation available