[rubygems/rubygems] Fix Ruby DSL no longer working as expected

https://github.com/rubygems/rubygems/commit/f6258e5679

Co-authored-by: AndrewSwerlick <andrew.swerlick@gmail.com>
This commit is contained in:
David Rodríguez 2023-12-15 17:02:15 +01:00 коммит произвёл Hiroshi SHIBATA
Родитель b8074c2f04
Коммит c8e9cd2b8b
2 изменённых файлов: 35 добавлений и 1 удалений

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

@ -20,7 +20,7 @@ module Bundler
GITHUB_PULL_REQUEST_URL = %r{\Ahttps://github\.com/([A-Za-z0-9_\-\.]+/[A-Za-z0-9_\-\.]+)/pull/(\d+)\z}
attr_reader :gemspecs
attr_reader :gemspecs, :gemfile
attr_accessor :dependencies
def initialize

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

@ -120,4 +120,38 @@ RSpec.describe "ruby requirement" do
expect(err).to include("There was an error parsing") # i.e. DSL error, not error template
end
it "allows picking up ruby version from a file" do
create_file ".ruby-version", Gem.ruby_version.to_s
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
ruby file: ".ruby-version"
gem "rack"
G
expect(lockfile).to include("RUBY VERSION")
end
it "reads the ruby version file from the right folder when nested Gemfiles are involved" do
create_file ".ruby-version", Gem.ruby_version.to_s
gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
ruby file: ".ruby-version"
gem "rack"
G
nested_dir = bundled_app(".ruby-lsp")
FileUtils.mkdir nested_dir
create_file ".ruby-lsp/Gemfile", <<-G
eval_gemfile(File.expand_path("../Gemfile", __dir__))
G
bundle "install", dir: nested_dir
expect(bundled_app(".ruby-lsp/Gemfile.lock").read).to include("RUBY VERSION")
end
end