Close the file descriptor in has_yaml_header?
Previous method caused a problem where the calling Dir.chdir to get the next directory's entries would cause the infamous 'Too many open files - getcwd' error. Fixes #2279.
This commit is contained in:
parent
1f94ca786d
commit
c2d3f9d5b5
|
@ -433,7 +433,7 @@ module Jekyll
|
|||
end
|
||||
|
||||
def has_yaml_header?(file)
|
||||
!!(File.open(file, "rb").read(5) =~ /\A---\r?\n/)
|
||||
!!(File.open(file, 'rb') { |f| f.read(5) } =~ /\A---\r?\n/)
|
||||
end
|
||||
|
||||
def limit_posts!
|
||||
|
|
Loading…
Reference in New Issue