|
SimpleTemplateEngine was not the problem. I'll open a new issue for File.write(string)
Jonathan Carlson made changes - 19/Sep/06 04:16 PM
I'm sorry I didn't get this straight before, but File.write(string) is working just like Java println does so that is not the problem. The problem still remains that a Windows template file (with \r\n) generates output with just \n Thanks in advance!
Jonathan Carlson made changes - 19/Sep/06 04:36 PM
The template script generates a lot of out.print "whatever \n" commands (notice the \n at the end of the line). If, instead, these types of lines could be converted to out.println "whatever" (use println with no \n at the end of the line) then it would always behave as it should.
Guillaume Laforge made changes - 20/Jan/07 03:27 PM
Paul King made changes - 04/Jul/07 08:18 AM
I'm sorry, it's been a long time since I've worked on this on Windows. Now I'm using a Mac and I haven't used the Template Engine since then, although I hope to use it again! Here's a very basic template test script I found in my scripting archive if it would help you! It seems to break the lines fine on Mac. // This script is an example for generating code or e-mails or HTML or whatever import groovy.text.Template // ===== Define the Template ===== println "\n=========== Generated Text 1 ===========" println "\n=========== Generated Text 2 ===========" Made the following little patch to SimpleTemplateEngine (partial code): Oh, here's the TemplateFile.txt content that the script uses: Dear ${firstname} ${lastname},
Paul King made changes - 26/Sep/07 11:45 PM
Paul King made changes - 10/Oct/07 05:49 AM
Paul King made changes - 22/Nov/07 05:29 AM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Come to think of it, the problem may be in the File.write(aString) method. I'm not sure where to find that, though.