From dca6ad863579fa5cf6e94de089293317f20609b8 Mon Sep 17 00:00:00 2001
From: Daniel Tull <dt@danieltull.co.uk>
Date: Sat, 16 Mar 2013 12:38:13 +0000
Subject: [PATCH] Escape spaces in the build mogen path, fixes #151

---
 test/Rakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/Rakefile b/test/Rakefile
index 69cb7fec..d31d7423 100644
--- a/test/Rakefile
+++ b/test/Rakefile
@@ -15,7 +15,7 @@ mogenPath = "#{built_products_dir}/mogenerator"
 def gen_and_compile(desc, mogenPath, extra_mogen_args, extra_gcc_args)
   puts "*** Testing #{desc}"
   ENV['MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS'] = '1'
-  run_or_die "#{mogenPath} --model test.xcdatamodel --output MOs --baseClass MyBaseClass #{extra_mogen_args}"
+  run_or_die "#{mogenPath.gsub(/ /, '\\ ')} --model test.xcdatamodel --output MOs --baseClass MyBaseClass #{extra_mogen_args}"
   run_or_die 'cp HumanMO.h HumanMO.m MyProtocol.h TestProtocol.m MOs'
   run_or_die "clang -o testbin test.m MyBaseClass.m MOs/*.m -I#{Dir.pwd} -framework Foundation -framework Cocoa -framework CoreData #{extra_gcc_args}"
   run_or_die "xcrun momc -MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS test.xcdatamodel #{Dir.pwd}/test.mom"