summaryrefslogtreecommitdiff
path: root/lib/optparse
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-23 18:31:23 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-24 11:00:34 +0900
commitba99eae2a596658a71079975fb7d53ae1f2341a5 (patch)
treede4f71d3d1d886059721da0692046fa43b21be31 /lib/optparse
parent098e8c2873ed7cfa276aa87967ce28ac711cbb30 (diff)
[ruby/optparse] 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/ruby/optparse/commit/df3933aa2b
Diffstat (limited to 'lib/optparse')
-rw-r--r--lib/optparse/optparse.gemspec4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/optparse/optparse.gemspec b/lib/optparse/optparse.gemspec
index d67060a63f..25f81c08bb 100644
--- a/lib/optparse/optparse.gemspec
+++ b/lib/optparse/optparse.gemspec
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
spec.metadata["source_code_uri"] = spec.homepage
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) 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"]
end