From b69859fbdf1229c5f9a478059d994fe2a17faee5 Mon Sep 17 00:00:00 2001 From: Watson Date: Tue, 15 Jan 2013 15:51:06 +0900 Subject: [PATCH] fix a bug in detecting dependencies where it would cause build error when passed non-flat array into `app.files' --- lib/motion/project/config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index fa7e3d43..74e943fe 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -258,7 +258,7 @@ EOS def files_dependencies(deps_hash) res_path = lambda do |x| path = /^\./.match(x) ? x : File.join('.', x) - unless @files.include?(path) + unless @files.flatten.include?(path) App.fail "Can't resolve dependency `#{x}'" end path @@ -292,7 +292,7 @@ EOS def ordered_build_files @ordered_build_files ||= begin - flat_deps = @files.map { |file| file_dependencies(file) }.flatten + flat_deps = @files.flatten.map { |file| file_dependencies(file) }.flatten paths = flat_deps.dup flat_deps.each do |path| n = paths.count(path)