Skip to content

Commit fba3ee3

Browse files
committed
Dir.glob is not working with bundled gems installation
1 parent b9daad7 commit fba3ee3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

logger.gemspec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ Gem::Specification.new do |spec|
1515
spec.homepage = "https://github.com/ruby/logger"
1616
spec.licenses = ["Ruby", "BSD-2-Clause"]
1717

18-
spec.files = Dir.glob("lib/**/*.rb") + ["logger.gemspec", "BSDL", "COPYING"]
18+
# Specify which files should be added to the gem when it is released.
19+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21+
`git ls-files -z 2>#{IO::NULL}`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22+
end
1923
spec.require_paths = ["lib"]
2024

2125
spec.required_ruby_version = ">= 2.5.0"

0 commit comments

Comments
 (0)