Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: tools/html_json_doc/lib/json_to_html.dart

Issue 11878015: Default constructor for dart:io Path now handles native Windows paths. Path() now does the same as… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't change tools/version.dart until the binaries are updated. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Library for taking a JSON file and putting the comments located within into 6 * Library for taking a JSON file and putting the comments located within into
7 * the HTML files the comments are associated with. 7 * the HTML files the comments are associated with.
8 * 8 *
9 * The format of the JSON file is: 9 * The format of the JSON file is:
10 * 10 *
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 completer.complete(false); 60 completer.complete(false);
61 } else { 61 } else {
62 fileJson = JSON.parse(jsonRead); 62 fileJson = JSON.parse(jsonRead);
63 } 63 }
64 64
65 // TODO(amouravski): Refactor to not duplicate code here and in html-to-json. 65 // TODO(amouravski): Refactor to not duplicate code here and in html-to-json.
66 // Find html files. (lister) 66 // Find html files. (lister)
67 final lister = htmlDir.list(recursive: false); 67 final lister = htmlDir.list(recursive: false);
68 68
69 lister.onFile = (String path) { 69 lister.onFile = (String path) {
70 final name = new Path.fromNative(path).filename; 70 final name = new Path(path).filename;
71 71
72 // Ignore private classes. 72 // Ignore private classes.
73 if (name.startsWith('_')) return; 73 if (name.startsWith('_')) return;
74 74
75 // Ignore non-dart files. 75 // Ignore non-dart files.
76 if (!name.endsWith('.dart')) return; 76 if (!name.endsWith('.dart')) return;
77 77
78 File file = new File(path); 78 File file = new File(path);
79 79
80 // TODO(amouravski): Handle missing file. 80 // TODO(amouravski): Handle missing file.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 // TODO(amouravski): file.writeAsStringSync('${Strings.join(fileLines, '\n')}\ n'); 147 // TODO(amouravski): file.writeAsStringSync('${Strings.join(fileLines, '\n')}\ n');
148 var outputStream = file.openOutputStream(); 148 var outputStream = file.openOutputStream();
149 outputStream.writeString(Strings.join(fileLines, '\n')); 149 outputStream.writeString(Strings.join(fileLines, '\n'));
150 outputStream.writeString('\n'); 150 outputStream.writeString('\n');
151 151
152 outputStream.onNoPendingWrites = () { 152 outputStream.onNoPendingWrites = () {
153 outputStream.close(); 153 outputStream.close();
154 }; 154 };
155 } 155 }
OLDNEW
« no previous file with comments | « tools/html_json_doc/lib/html_to_json.dart ('k') | tools/html_json_doc/test/html_json_doc_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698