diff options
author | bronzdoc <lsagastume1990@gmail.com> | 2020-04-26 11:54:32 -0600 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-08 14:13:29 +0900 |
commit | b454b4e3107921348bc13f8c024239f82965ed4a (patch) | |
tree | 58993add4ded6c8aaba305b1b84b6f97356a0c45 | |
parent | 4a417b08aeaf296238059e6abdb465c324073e15 (diff) | |
download | ruby-b454b4e3107921348bc13f8c024239f82965ed4a.tar.gz |
[rubygems/rubygems] Make MissingSpecError accept an extra error message
https://github.com/rubygems/rubygems/commit/b23d2421df
-rw-r--r-- | lib/rubygems/errors.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rubygems/errors.rb b/lib/rubygems/errors.rb index 2cd18e2e20..362a07865f 100644 --- a/lib/rubygems/errors.rb +++ b/lib/rubygems/errors.rb @@ -28,14 +28,15 @@ module Gem # superclass Gem::LoadError to catch all types of load errors. class MissingSpecError < Gem::LoadError - def initialize(name, requirement) + def initialize(name, requirement, extra_message=nil) @name = name @requirement = requirement + @extra_message = extra_message end def message # :nodoc: build_message + - "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information" + "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}' #{@extra_message}, execute `gem env` for more information" end private |