Use flat_map instead of map.flatten
This commit is contained in:
parent
95e96a0f83
commit
b9c4fc93d7
|
@ -49,7 +49,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns a Set with the directory paths
|
# Returns a Set with the directory paths
|
||||||
def new_dirs
|
def new_dirs
|
||||||
new_files.map { |file| parent_dirs(file) }.flatten.to_set
|
new_files.flat_map { |file| parent_dirs(file) }.to_set
|
||||||
end
|
end
|
||||||
|
|
||||||
# Private: The list of parent directories of a given file
|
# Private: The list of parent directories of a given file
|
||||||
|
@ -76,7 +76,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns a Set with the directory paths
|
# Returns a Set with the directory paths
|
||||||
def keep_dirs
|
def keep_dirs
|
||||||
site.keep_files.map{|file| parent_dirs(File.join(site.dest, file))}.flatten.to_set
|
site.keep_files.flat_map { |file| parent_dirs(File.join(site.dest, file)) }.to_set
|
||||||
end
|
end
|
||||||
|
|
||||||
# Private: Creates a regular expression from the config's keep_files array
|
# Private: Creates a regular expression from the config's keep_files array
|
||||||
|
|
Loading…
Reference in New Issue