Skip to content

Commit

Permalink
[rubygems/rubygems] This warrants a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and matzbot committed Dec 2, 2021
1 parent cf88271 commit 39f2b4f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/bundler/lazy_specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ def hash
identifier.hash
end

##
# Does this locked specification satisfy +dependency+?
#
# NOTE: Rubygems default requirement is ">= 0", which doesn't match
# prereleases of 0 versions, like "0.0.0.dev" or "0.0.0.SNAPSHOT". However,
# bundler users expect those to work. We need to make sure that Gemfile
# dependencies without explicit requirements (which use ">= 0" under the
# hood by default) are still valid for locked specs using this kind of
# versions. The method implements an ad-hoc fix for that. A better solution
# might be to change default rubygems requirement of dependencies to be ">=
# 0.A" but that's a major refactoring likely to break things. Hopefully we
# can attempt it in the future.
#

def satisfies?(dependency)
effective_requirement = dependency.requirement == Gem::Requirement.default ? Gem::Requirement.new(">= 0.A") : dependency.requirement

Expand Down

0 comments on commit 39f2b4f

Please sign in to comment.