From 45307215754b07279498e4f67b3e248ea632e153 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 27 Jun 2019 22:46:27 +0530 Subject: [PATCH] Replace `String#=~` with `String#match?` (#7723) Merge pull request 7723 --- lib/jekyll/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb index 2defd372..71dc9de5 100644 --- a/lib/jekyll/utils.rb +++ b/lib/jekyll/utils.rb @@ -135,7 +135,7 @@ module Jekyll # Returns true if the YAML front matter is present. # rubocop: disable PredicateName def has_yaml_header?(file) - !!(File.open(file, "rb", &:readline) =~ %r!\A---\s*\r?\n!) + File.open(file, "rb", &:readline).match? %r!\A---\s*\r?\n! rescue EOFError false end