Replace `String#=~` with `String#match?` (#7718)
Merge pull request 7718
This commit is contained in:
parent
25b274621b
commit
e10a90987a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue