diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-08-04 17:30:03 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-08-05 09:52:20 +0900 |
commit | 57911712011e285d76cf8132dd080b5727f43bf3 (patch) | |
tree | 178a2a9a3e61945057ab5fc671a61e67c216463c /tool/lib | |
parent | 661536ab168ab99e1dae31d661ff4807e7734ae4 (diff) | |
download | ruby-57911712011e285d76cf8132dd080b5727f43bf3.tar.gz |
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.
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/bundled_gem.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/lib/bundled_gem.rb b/tool/lib/bundled_gem.rb index 0b7d52b86a..38c331183d 100644 --- a/tool/lib/bundled_gem.rb +++ b/tool/lib/bundled_gem.rb @@ -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")} |