Handle EOF in Pathname#text_executable?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
d1a4806390
commit
1cce85b1f1
@ -273,6 +273,8 @@ class Pathname
|
|||||||
|
|
||||||
def text_executable?
|
def text_executable?
|
||||||
%r[#!\s*(/.+)+] === open('r') { |f| f.readline }
|
%r[#!\s*(/.+)+] === open('r') { |f| f.readline }
|
||||||
|
rescue EOFError
|
||||||
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def incremental_hash(hasher)
|
def incremental_hash(hasher)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user