From: Jörn Zaefferer Date: Sun, 8 Oct 2006 09:57:17 +0000 (+0000) Subject: Changed readFile to java-based read function to handle \r\n, fixes docs and test... X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=012153008398ea8fe57c19184d807250b38164a0;p=jquery.git Changed readFile to java-based read function to handle \r\n, fixes docs and test, lite still broken --- diff --git a/build/docs/docs.js b/build/docs/docs.js index a40f56a..8f331ea 100644 --- a/build/docs/docs.js +++ b/build/docs/docs.js @@ -2,7 +2,7 @@ load("build/js/json.js", "build/js/xml.js", "build/js/writeFile.js", "build/js/p var dir = arguments[1]; -var c = parse( readFile(arguments[0]) ); +var c = parse( read(arguments[0]) ); output( c, "docs" ); c = categorize( c ); diff --git a/build/js/writeFile.js b/build/js/writeFile.js index 9e6e008..43b1eb2 100644 --- a/build/js/writeFile.js +++ b/build/js/writeFile.js @@ -5,3 +5,15 @@ function writeFile( file, stream ) { buffer.print( stream ); buffer.close(); } + +function read( file ) { + var jq = new File(file); + var reader = new BufferedReader(new FileReader(jq)); + var line = null; + var buffer = new java.lang.StringBuffer(jq.length()); + while( (line = reader.readLine()) != null) { + buffer.append(line); + buffer.append("\n"); + } + return buffer.toString(); +} \ No newline at end of file diff --git a/build/test/test.js b/build/test/test.js index 4a6f0c2..e76b795 100644 --- a/build/test/test.js +++ b/build/test/test.js @@ -16,7 +16,7 @@ function addTestWrapper(name, test) { } var dir = arguments[1]; -var jq = parse( readFile( arguments[0] ) ); +var jq = parse( read(arguments[0]) ); var testFile = [];