Support bundler local_search on 2.4.1 and higher

This commit is contained in:
Josh Schramm 2022-12-29 08:50:18 -05:00
Родитель a6272b166d
Коммит ac4761959a
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -18,7 +18,12 @@ module Licensed
all_dependencies = requested_dependencies.concat(specs.flat_map(&:dependencies))
if all_dependencies.any? { |d| d.name == "bundler" } && !specs["bundler"].any?
bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", ::Bundler::VERSION)).last
if ::Bundler::VERSION >= "2.4.1"
query = ["bundler", ::Bundler::VERSION]
else
query = Gem::Dependency.new("bundler", ::Bundler::VERSION)
end
bundler = sources.metadata_source.specs.search(query).last
specs["bundler"] = bundler
end