Skip to content
Permalink
Browse files

limit scope path globbing to just patterns with *

  • Loading branch information...
ashmaroli committed Jan 15, 2018
1 parent 28559b7 commit 776433109b96cb644938ffbf9caf4923bdde4d7f
Showing with 1 addition and 8 deletions.
  1. +1 −8 lib/jekyll/frontmatter_defaults.rb
@@ -106,7 +106,7 @@ def applies_path?(scope, path)
rel_scope_path = Pathname.new(scope["path"])
abs_scope_path = File.join(@site.source, rel_scope_path)

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

def glob_pattern?(path)
path.each_filename do |str|
return true if str =~ %r!\*+|\?|\[.*\]|{.*}!
end
false
end

# Determines whether the scope applies to type.
# The scope applies to the type if:
# 1. no 'type' is specified

0 comments on commit 7764331

Please sign in to comment.
You can’t perform that action at this time.