Move to flat_map now that we don't use 1.8
This commit is contained in:
parent
ac64b17ef0
commit
7f1285a773
|
@ -139,15 +139,14 @@ module Middleman
|
|||
# @param paths Some paths string or Pathname
|
||||
# @return [Array] An array of filenames
|
||||
def self.all_files_under(*paths)
|
||||
# when we drop 1.8, replace this with flat_map
|
||||
paths.map do |p|
|
||||
paths.flat_map do |p|
|
||||
path = Pathname(p)
|
||||
if path.directory?
|
||||
all_files_under(*path.children)
|
||||
elsif path.file?
|
||||
path
|
||||
end
|
||||
end.flatten.compact
|
||||
end.compact
|
||||
end
|
||||
|
||||
# Given a source path (referenced either absolutely or relatively)
|
||||
|
|
Loading…
Reference in a new issue