diff --git a/middleman-core/lib/middleman-core/util.rb b/middleman-core/lib/middleman-core/util.rb index b0883fdc..54d6b63f 100644 --- a/middleman-core/lib/middleman-core/util.rb +++ b/middleman-core/lib/middleman-core/util.rb @@ -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) diff --git a/middleman-core/spec/spec_helper.rb b/middleman-core/spec/spec_helper.rb index 7ef65140..a9d71768 100644 --- a/middleman-core/spec/spec_helper.rb +++ b/middleman-core/spec/spec_helper.rb @@ -2,4 +2,4 @@ require 'simplecov' SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/..')) require 'coveralls' -Coveralls.wear! \ No newline at end of file +Coveralls.wear!