Visitar URL original
limit scope path globbing to just patterns with * · jekyll/jekyll@7764331 · GitHub
Skip to content

Commit 7764331

Browse files
committed
limit scope path globbing to just patterns with *
1 parent 28559b7 commit 7764331

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎lib/jekyll/frontmatter_defaults.rb‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def applies_path?(scope, path)
106106
rel_scope_path = Pathname.new(scope["path"])
107107
abs_scope_path = File.join(@site.source, rel_scope_path)
108108

109-
if glob_pattern?(rel_scope_path)
109+
if scope["path"].to_s.include?("*")
110110
Dir.glob(abs_scope_path).each do |scope_path|
111111
scope_path = Pathname.new(scope_path).relative_path_from site_path
112112
Jekyll.logger.debug "Globbed Scope Path:", scope_path
@@ -128,13 +128,6 @@ def path_is_subpath?(path, parent_path)
128128
false
129129
end
130130

131-
def glob_pattern?(path)
132-
path.each_filename do |str|
133-
return true if str =~ %r!\*+|\?|\[.*\]|{.*}!
134-
end
135-
false
136-
end
137-
138131
# Determines whether the scope applies to type.
139132
# The scope applies to the type if:
140133
# 1. no 'type' is specified

0 commit comments

Comments
 (0)