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
|
# @param paths Some paths string or Pathname
|
||||||
# @return [Array] An array of filenames
|
# @return [Array] An array of filenames
|
||||||
def self.all_files_under(*paths)
|
def self.all_files_under(*paths)
|
||||||
# when we drop 1.8, replace this with flat_map
|
paths.flat_map do |p|
|
||||||
paths.map do |p|
|
|
||||||
path = Pathname(p)
|
path = Pathname(p)
|
||||||
if path.directory?
|
if path.directory?
|
||||||
all_files_under(*path.children)
|
all_files_under(*path.children)
|
||||||
elsif path.file?
|
elsif path.file?
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
end.flatten.compact
|
end.compact
|
||||||
end
|
end
|
||||||
|
|
||||||
# Given a source path (referenced either absolutely or relatively)
|
# Given a source path (referenced either absolutely or relatively)
|
||||||
|
|
|
@ -2,4 +2,4 @@ require 'simplecov'
|
||||||
SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/..'))
|
SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/..'))
|
||||||
|
|
||||||
require 'coveralls'
|
require 'coveralls'
|
||||||
Coveralls.wear!
|
Coveralls.wear!
|
||||||
|
|
Loading…
Reference in a new issue