aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/dependency.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/dependency.rb')
-rw-r--r--lib/rubygems/dependency.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb
index b7aea4692b..ecfd0b7909 100644
--- a/lib/rubygems/dependency.rb
+++ b/lib/rubygems/dependency.rb
@@ -286,9 +286,7 @@ class Gem::Dependency
}
end
- # `stubs_for` returns oldest first, but `matching_specs` is supposed to
- # return newest first, so just reverse the list
- matches.reverse
+ matches
end
##
@@ -307,18 +305,10 @@ class Gem::Dependency
specs = Gem::Specification.stubs_for name
if specs.empty?
- total = Gem::Specification.stubs.size
- msg = "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n".dup
+ raise Gem::MissingSpecError.new name, requirement
else
- specs = specs.map(&:full_name)
- msg = "Could not find '#{name}' (#{requirement}) - did find: [#{specs.join ','}]\n".dup
+ raise Gem::MissingSpecVersionError.new name, requirement, specs
end
- msg << "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
-
- error = Gem::LoadError.new(msg)
- error.name = self.name
- error.requirement = self.requirement
- raise error
end
# TODO: any other resolver validations should go here