diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-07-06 22:07:34 -0300 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-07-10 12:07:57 -0300 |
commit | d7db30cbfa96f506f4605c24f00cd2fbe3b40dd8 (patch) | |
tree | 6b5a60b09c6eaed6ae83ab7e6ad86211493f6a72 | |
parent | a0fbb6a608fc6f3bf1b973412657f18a4af04dd1 (diff) | |
download | bundler-d7db30cbfa96f506f4605c24f00cd2fbe3b40dd8.tar.gz |
[Resolver] Ensure that spec.required_ruby_version exists before using it
-rw-r--r-- | lib/bundler/resolver.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index 50a391e592..9d947cc9f9 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -125,7 +125,13 @@ module Bundler def for?(platform, ruby_version) spec = @specs[platform] return false unless spec - return true if ruby_version.nil? || !spec.is_a?(EndpointSpecification) + + return true if ruby_version.nil? + # Only allow endpoint specifications since they won't hit the network to + # fetch the full gemspec when calling required_ruby_version + return true if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification) + return true if spec.required_ruby_version.nil? + spec.required_ruby_version.satisfied_by?(ruby_version.to_gem_version_with_patchlevel) end |