From 5810a76440ba4e2a0f4d097d9069bb4fd02cccae Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 9 Jan 2025 17:31:45 +0900 Subject: [PATCH] Dir.glob is not working with bundled gems installation --- logger.gemspec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logger.gemspec b/logger.gemspec index d0b3e19..09d9600 100644 --- a/logger.gemspec +++ b/logger.gemspec @@ -15,7 +15,11 @@ Gem::Specification.new do |spec| spec.homepage = "https://github.com/ruby/logger" spec.licenses = ["Ruby", "BSD-2-Clause"] - spec.files = Dir.glob("lib/**/*.rb") + ["logger.gemspec", "BSDL", "COPYING"] + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end spec.require_paths = ["lib"] spec.required_ruby_version = ">= 2.5.0"