extend/pathname: fix text_executable? regex

This commit is contained in:
Bo Anderson 2023-06-25 17:33:49 +01:00
parent 5bf89a3d22
commit e74f0dd787
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -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) }