Skip to content

Commit df3933a

Browse files
committed
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.
1 parent 4c0021b commit df3933a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

optparse.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
2121
spec.metadata["source_code_uri"] = spec.homepage
2222

2323
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
2525
end
2626
spec.bindir = "exe"
27-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
2828
spec.require_paths = ["lib"]
2929
end

0 commit comments

Comments
 (0)