diff --git a/logger.gemspec b/logger.gemspec index 09d9600..d8ffba0 100644 --- a/logger.gemspec +++ b/logger.gemspec @@ -17,9 +17,12 @@ Gem::Specification.new do |spec| # 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 + pattern = %W[ + :(glob,top)* :/exe :/ext :/lib + :^/.git* :^/Gemfile* :^/Rakefile* + :(literal,top,exclude)#{File.basename(__FILE__)} + ] + spec.files = IO.popen(%w[git ls-files -z] + pattern, chdir: __dir__, &:read).split("\0") spec.require_paths = ["lib"] spec.required_ruby_version = ">= 2.5.0"