From e10a90987a382bbf94a4ed22f660457a0277ef4a Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Mon, 24 Jun 2019 23:16:28 +0530 Subject: [PATCH] Replace `String#=~` with `String#match?` (#7718) Merge pull request 7718 --- lib/jekyll/tags/include.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index d81dd8de..b43fe453 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -54,7 +54,7 @@ module Jekyll end def validate_file_name(file) - if file =~ INVALID_SEQUENCES || file !~ VALID_FILENAME_CHARS + if file.match?(INVALID_SEQUENCES) || !file.match?(VALID_FILENAME_CHARS) raise ArgumentError, <<~MSG Invalid syntax for include tag. File contains invalid characters or sequences: @@ -90,7 +90,7 @@ module Jekyll # Render the variable if required def render_variable(context) - Liquid::Template.parse(@file).render(context) if @file =~ VARIABLE_SYNTAX + Liquid::Template.parse(@file).render(context) if @file.match?(VARIABLE_SYNTAX) end def tag_includes_dirs(context)