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"