From 70d4671d2c2588690de27950ba28bda49009ff6e Mon Sep 17 00:00:00 2001 From: Eliott Appleford Date: Sun, 14 Jun 2015 11:55:10 +0100 Subject: [PATCH] Allow extended globs with ignore This makes it match the default behaviour of Dir#glob --- .../lib/middleman-core/sitemap/extensions/ignores.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/middleman-core/lib/middleman-core/sitemap/extensions/ignores.rb b/middleman-core/lib/middleman-core/sitemap/extensions/ignores.rb index df803505..c26f8a80 100644 --- a/middleman-core/lib/middleman-core/sitemap/extensions/ignores.rb +++ b/middleman-core/lib/middleman-core/sitemap/extensions/ignores.rb @@ -59,7 +59,11 @@ module Middleman elsif path.is_a? String path_clean = ::Middleman::Util.normalize_path(path) if path_clean.include?('*') # It's a glob - @ignored_callbacks << proc { |p| File.fnmatch(path_clean, p) } + if defined? File::FNM_EXTGLOB + @ignored_callbacks << proc { |p| File.fnmatch(path_clean, p, File::FNM_EXTGLOB) } + else + @ignored_callbacks << proc { |p| File.fnmatch(path_clean, p) } + end else # Add a specific-path ignore unless that path is already covered return if ignored?(path_clean)