1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Load gemspec file at that directory

Gemspec files generated by old bundler run `git` without changing the
working directory.
Or some gemspec files expect an owned file at the top exists ath the
current working directory.
This commit is contained in:
Nobuyoshi Nakada 2022-08-04 17:30:03 +09:00
parent 661536ab16
commit 5791171201
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2022-08-05 13:00:55 +09:00

View file

@ -15,8 +15,8 @@ module BundledGem
end
def copy(path, *rest)
spec = Gem::Specification.load(path)
path = File.dirname(path)
path, n = File.split(path)
spec = Dir.chdir(path) {Gem::Specification.load(n)} or raise "Cannot load #{path}"
prepare_test(spec, *rest) do |dir|
FileUtils.rm_rf(dir)
files = spec.files.reject {|f| f.start_with?(".git")}