summaryrefslogtreecommitdiff
path: root/lib/rubygems/errors.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/errors.rb')
-rw-r--r--lib/rubygems/errors.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/rubygems/errors.rb b/lib/rubygems/errors.rb
index ac82a551a5..4bbc5217e0 100644
--- a/lib/rubygems/errors.rb
+++ b/lib/rubygems/errors.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
#--
# This file contains all the various exceptions and other errors that are used
# inside of RubyGems.
@@ -25,10 +26,11 @@ module Gem
# system. Instead of rescuing from this class, make sure to rescue from the
# superclass Gem::LoadError to catch all types of load errors.
class MissingSpecError < Gem::LoadError
- def initialize(name, requirement, extra_message=nil)
+ def initialize(name, requirement, extra_message = nil)
@name = name
@requirement = requirement
@extra_message = extra_message
+ super(message)
end
def message # :nodoc:
@@ -52,15 +54,15 @@ module Gem
attr_reader :specs
def initialize(name, requirement, specs)
- super(name, requirement)
@specs = specs
+ super(name, requirement)
end
private
def build_message
names = specs.map(&:full_name)
- "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n"
+ "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ","}]\n"
end
end
@@ -133,11 +135,7 @@ module Gem
##
# A wordy description of the error.
def wordy
- "Found %s (%s), but was for platform%s %s" %
- [@name,
- @version,
- @platforms.size == 1 ? "" : "s",
- @platforms.join(" ,")]
+ format("Found %s (%s), but was for platform%s %s", @name, @version, @platforms.size == 1 ? "" : "s", @platforms.join(" ,"))
end
end
@@ -174,6 +172,6 @@ module Gem
##
# The "exception" alias allows you to call raise on a SourceFetchProblem.
- alias exception error
+ alias_method :exception, :error
end
end