Merge pull request #15586 from Bo98/text-executable-regex
extend/pathname: fix `text_executable?` regex
This commit is contained in:
commit
bb23116d3c
@ -271,7 +271,7 @@ class Pathname
|
||||
# @private
|
||||
sig { returns(T::Boolean) }
|
||||
def text_executable?
|
||||
/^#!\s*\S+/.match?(open("r") { |f| f.read(1024) })
|
||||
/\A#!\s*\S+/.match?(open("r") { |f| f.read(1024) })
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user