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

Unified Diff: third_party/pkg/angular/lib/tools/io_impl.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 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
Index: third_party/pkg/angular/lib/tools/io_impl.dart
diff --git a/third_party/pkg/angular/lib/tools/io_impl.dart b/third_party/pkg/angular/lib/tools/io_impl.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e0397cef072b617563cb4a1ffdbe08bdbf7c035d
--- /dev/null
+++ b/third_party/pkg/angular/lib/tools/io_impl.dart
@@ -0,0 +1,22 @@
+library angular.io_impl;
+
+import 'dart:io';
+import 'io.dart';
+
+class IoServiceImpl implements IoService {
+
+ String readAsStringSync(String filePath) =>
+ new File(filePath).readAsStringSync();
+
+ void visitFs(String rootDir, FsVisitor visitor) {
+ Directory root = new Directory(rootDir);
+ if (!FileSystemEntity.isDirectorySync(rootDir)) {
+ throw 'Expected $rootDir to be a directory!';
+ }
+ root.listSync(recursive: true, followLinks: true).forEach((entity) {
+ if (entity.statSync().type == FileSystemEntityType.FILE) {
+ visitor(entity.path);
+ }
+ });
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698