diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-08 01:32:18 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-08 01:32:18 +0000 |
commit | c00e84327f14845bd484e76b5ee5dfeb1fa9ce3d (patch) | |
tree | 9f558dafa363f4f0118d504a50cd4461e2821cd1 /lib/rubygems/installer.rb | |
parent | 6b05153a3a75b74b64553d6a46f501d9ee0f0376 (diff) | |
download | ruby-c00e84327f14845bd484e76b5ee5dfeb1fa9ce3d.tar.gz |
Merge rubygems master.
This is RC version of Rubygems 2.7.0.
https://github.com/rubygems/rubygems/commit/688fb7e83c13c3fe7c2bb03c49a2db4c82852aee
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/installer.rb')
-rw-r--r-- | lib/rubygems/installer.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index 6fd3399dd4..0cbca0791b 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -136,8 +136,9 @@ class Gem::Installer end ## - # Constructs an Installer instance that will install the gem located at - # +gem+. +options+ is a Hash with the following keys: + # Constructs an Installer instance that will install the gem at +package+ which + # can either be a path or an instance of Gem::Package. +options+ is a Hash + # with the following keys: # # :bin_dir:: Where to put a bin wrapper if needed. # :development:: Whether or not development dependencies should be installed. @@ -157,6 +158,7 @@ class Gem::Installer # :wrappers:: Install wrappers if true, symlinks if false. # :build_args:: An Array of arguments to pass to the extension builder # process. If not set, then Gem::Command.build_args is used + # :post_install_message:: Print gem post install message if true def initialize(package, options={}) require 'fileutils' @@ -471,7 +473,7 @@ class Gem::Installer unless File.exist? bin_path then # TODO change this to a more useful warning - warn "#{bin_path} maybe `gem pristine #{spec.name}` will fix it?" + warn "`#{bin_path}` does not exist, maybe `gem pristine #{spec.name}` will fix it?" next end @@ -608,7 +610,9 @@ class Gem::Installer def ensure_required_ruby_version_met # :nodoc: if rrv = spec.required_ruby_version then unless rrv.satisfied_by? Gem.ruby_version then - raise Gem::InstallError, "#{spec.name} requires Ruby version #{rrv}." + ruby_version = Gem.ruby_api_version + raise Gem::RuntimeRequirementNotMetError, + "#{spec.name} requires Ruby version #{rrv}. The current ruby version is #{ruby_version}." end end end @@ -616,8 +620,9 @@ class Gem::Installer def ensure_required_rubygems_version_met # :nodoc: if rrgv = spec.required_rubygems_version then unless rrgv.satisfied_by? Gem.rubygems_version then - raise Gem::InstallError, - "#{spec.name} requires RubyGems version #{rrgv}. " + + rg_version = Gem::VERSION + raise Gem::RuntimeRequirementNotMetError, + "#{spec.name} requires RubyGems version #{rrgv}. The current RubyGems version is #{rg_version}. " + "Try 'gem update --system' to update RubyGems itself." end end @@ -821,7 +826,7 @@ TEXT # # Version and dependency checks are skipped if this install is forced. # - # The dependent check will be skipped this install is ignoring dependencies. + # The dependent check will be skipped if the install is ignoring dependencies. def pre_install_checks verify_gem_home options[:unpack] |