]> source.dussan.org Git - jquery.git/commitdiff
Changed readFile to java-based read function to handle \r\n, fixes docs and test...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 8 Oct 2006 09:57:17 +0000 (09:57 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 8 Oct 2006 09:57:17 +0000 (09:57 +0000)
build/docs/docs.js
build/js/writeFile.js
build/test/test.js

index a40f56a237a8dcded5d44f90d5d3792013fada25..8f331ea3efc995183e8f8c822ad5f7bc6df35c22 100644 (file)
@@ -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 );
index 9e6e008eba64230a7956cd1484e418a41e73529c..43b1eb246af749639263d08b8a6fbf4e3fede0d8 100644 (file)
@@ -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
index 4a6f0c2f60cfbcc3ad4fcdbb6c47c8891f3db3b2..e76b795a2ca541c4cff6a732c956ad6ae3fba548 100644 (file)
@@ -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 = [];