From f546c673627be3e2d364af66a2aff7dc188d3be2 Mon Sep 17 00:00:00 2001 From: Jeremy Ruppel Date: Tue, 14 May 2013 12:41:24 -0700 Subject: [PATCH 1/2] Print mutated path if a dependency cannot be found --- lib/motion/project/config.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index 33fe4933..921ce2c7 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -1,15 +1,15 @@ # Copyright (c) 2012, HipByte SPRL and contributors # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# +# # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -207,7 +207,7 @@ module Motion; module Project res_path = lambda do |x| path = /^\.?\//.match(x) ? x : File.join('.', x) unless @files.flatten.include?(path) - App.fail "Can't resolve dependency `#{x}'" + App.fail "Can't resolve dependency `#{path}'" end path end @@ -233,10 +233,10 @@ module Motion; module Project if deps deps = deps.map { |x| file_dependencies(x) } else - deps = [] + deps = [] end deps << file - deps + deps end def ordered_build_files From 9c2064eef2ec53e3ea97354eadcaad6275318fc2 Mon Sep 17 00:00:00 2001 From: Jeremy Ruppel Date: Tue, 14 May 2013 12:42:58 -0700 Subject: [PATCH 2/2] Support leading ".." notation in dependency pathnames --- lib/motion/project/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index 921ce2c7..f49de294 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -205,7 +205,7 @@ module Motion; module Project def files_dependencies(deps_hash) res_path = lambda do |x| - path = /^\.?\//.match(x) ? x : File.join('.', x) + path = /^\.{0,2}\//.match(x) ? x : File.join('.', x) unless @files.flatten.include?(path) App.fail "Can't resolve dependency `#{path}'" end