[前][次][番号順一覧][スレッド一覧]

ruby-changes:63170

From: Nobuyoshi <ko1@a...>
Date: Mon, 28 Sep 2020 14:54:58 +0900 (JST)
Subject: [ruby-changes:63170] 18c642da86 (master): [rubygems/rubygems] Fix ls-files matching regexp

https://git.ruby-lang.org/ruby.git/commit/?id=18c642da86

From 18c642da869876da1100d046e8ac6556c3638e91 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 23 Jul 2020 02:36:27 +0900
Subject: [rubygems/rubygems] Fix ls-files matching regexp

As splitting by NUL means to allow the file names to contain
newlines, path names should match at beginning-of-string instead
of beginning-of-line.

https://github.com/rubygems/rubygems/commit/8a81183236

diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
index b5ccac4..5b34f64 100644
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ b/lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -25,10 +25,10 @@ Gem::Specification.new do |spec| https://github.com/ruby/ruby/blob/trunk/lib/bundler/templates/newgem/newgem.gemspec.tt#L25
   # 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(__dir__)) do
-    `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
+    `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
   end
   spec.bindir        = "exe"
-  spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
+  spec.executables   = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
   spec.require_paths = ["lib"]
 <%- if config[:ext] -%>
   spec.extensions    = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]