summaryrefslogtreecommitdiff
path: root/lib/bundler/lazy_specification.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-11-30 18:12:54 +0100
committergit <svn-admin@ruby-lang.org>2021-12-02 18:10:32 +0900
commit39f2b4f1a4a0075c08ce9575a51ccea48c85f024 (patch)
tree1cafe29386015f1b005c8861de1d9a97c4a26623 /lib/bundler/lazy_specification.rb
parentcf882713312576a827abff8ddf7eb620e1f3f6d8 (diff)
[rubygems/rubygems] This warrants a comment
https://github.com/rubygems/rubygems/commit/8fa29e5e55
Diffstat (limited to 'lib/bundler/lazy_specification.rb')
-rw-r--r--lib/bundler/lazy_specification.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 104225e9ee..4eb228f314 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -38,6 +38,20 @@ module Bundler
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