diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-02-01 11:14:04 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-02-01 11:14:57 +0900 |
commit | 600a715c9bde99fe2e9a669465d78833445273e8 (patch) | |
tree | 8244622e8cc02b40dd0dad29d30fc60a11342396 /lib/rubygems/installer.rb | |
parent | adc303131187654d8ce83f3db17eefa3d5bae26c (diff) | |
download | ruby-600a715c9bde99fe2e9a669465d78833445273e8.tar.gz |
Merge the current master branch of rubygems/rubygems.
Just started to develop RubyGems 3.2.0.
Diffstat (limited to 'lib/rubygems/installer.rb')
-rw-r--r-- | lib/rubygems/installer.rb | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index ad39ec81bf..2ba92482cc 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -6,6 +6,7 @@ #++ require 'rubygems/command' +require 'rubygems/installer_uninstaller_utils' require 'rubygems/exceptions' require 'rubygems/deprecate' require 'rubygems/package' @@ -43,6 +44,8 @@ class Gem::Installer include Gem::UserInteraction + include Gem::InstallerUninstallerUtils + ## # Filename of the gem being installed. @@ -180,15 +183,7 @@ class Gem::Installer require 'fileutils' @options = options - if package.is_a? String - security_policy = options[:security_policy] - @package = Gem::Package.new package, security_policy - if $VERBOSE - warn "constructing an Installer object with a string is deprecated. Please use Gem::Installer.at (called from: #{caller.first})" - end - else - @package = package - end + @package = package process_options @@ -330,6 +325,7 @@ class Gem::Installer end generate_bin + generate_plugins unless @options[:install_as_default] write_spec @@ -520,7 +516,17 @@ class Gem::Installer else generate_bin_symlink filename, @bin_dir end + end + end + def generate_plugins # :nodoc: + latest = Gem::Specification.latest_spec_for(spec.name) + return if latest && latest.version > spec.version + + if spec.plugins.empty? + remove_plugins_for(spec) + else + regenerate_plugins_for(spec) end end @@ -810,7 +816,7 @@ TEXT ruby_exe = "ruby.exe" if ruby_exe.empty? if File.exist?(File.join bindir, ruby_exe) - # stub & ruby.exe withing same folder. Portable + # stub & ruby.exe within same folder. Portable <<-TEXT @ECHO OFF @"%~dp0#{ruby_exe}" "%~dpn0" %* @@ -845,18 +851,6 @@ TEXT end ## - # Logs the build +output+ in +build_dir+, then raises Gem::Ext::BuildError. - # - # TODO: Delete this for RubyGems 4. It remains for API compatibility - - def extension_build_error(build_dir, output, backtrace = nil) # :nodoc: - builder = Gem::Ext::Builder.new spec, @build_args - - builder.build_error build_dir, output, backtrace - end - deprecate :extension_build_error, :none, 2018, 12 - - ## # Reads the file index and extracts each file into the gem directory. # # Ensures that files can't be installed outside the gem directory. |