From 573522bd8481db8d0cb042810b95bd573bd5fb23 Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Sun, 5 Feb 2023 13:58:54 +1100 Subject: [PATCH] [rubygems/rubygems] Simplify the gem package file filter in the gemspec template The regular expression is difficult to understand at a glance. Let's replace it with a much simpler string comparison. https://github.com/rubygems/rubygems/commit/a3745aa03f --- lib/bundler/templates/newgem/newgem.gemspec.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt index 69c86ea27b..ee1c31522c 100644 --- a/lib/bundler/templates/newgem/newgem.gemspec.tt +++ b/lib/bundler/templates/newgem/newgem.gemspec.tt @@ -29,7 +29,7 @@ Gem::Specification.new do |spec| # The `git ls-files -z` loads the files in the RubyGem that have been added into git. spec.files = Dir.chdir(__dir__) do `git ls-files -z`.split("\x0").reject do |f| - (File.expand_path(f) == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)}) + (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin test spec features .git .circleci appveyor]) end end spec.bindir = "exe"