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

Unified Diff: sdk/lib/_internal/dartdoc/lib/dartdoc.dart

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/io_patch.dart ('k') | sdk/lib/io/chunked_stream.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/dartdoc/lib/dartdoc.dart
diff --git a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
index e0305ab5829217de350f5dabe6583050fdf3e5e1..a6f0179da8bead52e2e1b6077ef75327d58be971 100644
--- a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
+++ b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -107,18 +107,19 @@ String displayName(LibraryMirror library) {
Future copyDirectory(Path from, Path to) {
final completer = new Completer();
final fromDir = new Directory.fromPath(from);
- final lister = fromDir.list(recursive: false);
-
- lister.onFile = (String path) {
- final name = new Path(path).filename;
- // TODO(rnystrom): Hackish. Ignore 'hidden' files like .DS_Store.
- if (name.startsWith('.')) return;
-
- File fromFile = new File(path);
- File toFile = new File.fromPath(to.append(name));
- fromFile.openInputStream().pipe(toFile.openOutputStream());
- };
- lister.onDone = (done) => completer.complete(true);
+ fromDir.list(recursive: false).listen(
+ (FileSystemEntity entity) {
+ if (entity is File) {
+ final name = new Path(entity.name).filename;
+ // TODO(rnystrom): Hackish. Ignore 'hidden' files like .DS_Store.
+ if (name.startsWith('.')) return;
+
+ File fromFile = entity;
+ File toFile = new File.fromPath(to.append(name));
+ fromFile.openRead().pipe(toFile.openWrite());
+ }
+ },
+ onDone: () => completer.complete(true));
return completer.future;
}
@@ -175,7 +176,7 @@ class PackageManifest {
* Path to the directory containing data files for each library.
*
* Currently this is the serialized json version of the LibraryElement for
- * the library.
+ * the library.
*/
String location;
/**
@@ -1902,15 +1903,18 @@ class Dartdoc {
write("NETWORK:\n*\n\n");
write("CACHE:\n");
var toCache = new Directory.fromPath(outputDir);
- var toCacheLister = toCache.list(recursive: true);
- toCacheLister.onFile = (filename) {
- if (filename.endsWith('appcache.manifest')) {
- return;
- }
- Path relativeFilePath = new Path(filename).relativeTo(outputDir);
- write("$relativeFilePath\n");
- };
- toCacheLister.onDone = (done) => endFile();
+ toCache.list(recursive: true).listen(
+ (FileSystemEntity entity) {
+ if (entity.isFile) {
+ var filename = entity.path;
+ if (filename.endsWith('appcache.manifest')) {
+ return;
+ }
+ Path relativeFilePath = new Path(filename).relativeTo(outputDir);
+ write("$relativeFilePath\n");
+ }
+ },
+ onDone: () => endFile());
}
/**
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/io_patch.dart ('k') | sdk/lib/io/chunked_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698