summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tool/lib/bundled_gem.rb4
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")}