Replace `String#=~` with `String#match?` (#7718)

Merge pull request 7718
This commit is contained in:
Ashwin Maroli 2019-06-24 23:16:28 +05:30 committed by jekyllbot
parent 25b274621b
commit e10a90987a
1 changed files with 2 additions and 2 deletions

View File

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