use Array.join instead of Array.inject, add .svn to defaults

This commit is contained in:
edeustace 2012-12-09 11:43:49 +01:00
parent 3da0bb3a74
commit 4bae42a671
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ module Jekyll
'source' => Dir.pwd,
'destination' => File.join(Dir.pwd, '_site'),
'plugins' => File.join(Dir.pwd, '_plugins'),
'keep_files' => ['.git'],
'keep_files' => ['.git','.svn'],
'layouts' => '_layouts',
'future' => true,

View File

@ -251,7 +251,7 @@ module Jekyll
# create a regex from the keep_files array
# ['.git','.svn'] => /\/(\.git|\/.svn)/
def keep_file_regex
or_list = self.keep_files.map.inject("") { |x,y| "#{x}|#{y}" }[1..-1]
or_list = self.keep_files.join("|")
pattern = "\/(#{or_list.gsub(".", "\.")})"
Regexp.new pattern
end