From 18215676a8a0983b22211286be29bf114213b9b2 Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Mon, 13 Jun 2011 05:52:46 -0700 Subject: [PATCH 1/2] Using compile instead of precompile broke my project --- src/project.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/project.coffee b/src/project.coffee index 2957887..54f6dde 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -323,7 +323,7 @@ class Project # .. ok .. try - output = eco.compile(new String(code)) + output = eco.precompile(new String(code)) catch err sys.puts " * Error compiling #{file}" sys.puts err.message From aa8acb8fa301d76312df99b05b02a76a10779eed Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Mon, 13 Jun 2011 17:20:31 -0700 Subject: [PATCH 2/2] made $templates work again --- src/project.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/project.coffee b/src/project.coffee index 54f6dde..9089169 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -323,7 +323,7 @@ class Project # .. ok .. try - output = eco.precompile(new String(code)) + output = eco.compile(new String(code)) catch err sys.puts " * Error compiling #{file}" sys.puts err.message @@ -334,8 +334,8 @@ class Project Path.basename(file, ".eco").capitalize() ].join("") - output = output.replace(/^module.exports/, "this.$templates.#{templateName}") - output = "if(!this.$templates){\n $templates={};\n};\n\n" + output + output = output.toString().replace(/^module.exports/, "this.$templates.#{templateName}"); + output = "if(!this.$templates){\n $templates={};\n};\n\n this.$templates.#{templateName} = " + output sys.puts " * Compiled " + outpath fs.writeFileSync Path.join(@root, outpath), output