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

Unified Diff: pkg/polymer/lib/src/file_system/console.dart

Issue 23898009: Switch polymer's build.dart to use the new linter. This CL does the following (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: addressing john comments (part 2) - renamed files Created 7 years, 3 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 | « pkg/polymer/lib/src/file_system.dart ('k') | pkg/polymer/lib/src/files.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/file_system/console.dart
diff --git a/pkg/polymer/lib/src/file_system/console.dart b/pkg/polymer/lib/src/file_system/console.dart
deleted file mode 100644
index 346eb4b3a4baa11d9eefda0957b9653dd8ba0587..0000000000000000000000000000000000000000
--- a/pkg/polymer/lib/src/file_system/console.dart
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2012, 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.
-
-library console;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:io';
-import 'package:polymer/src/file_system.dart';
-
-/** File system implementation for console VM (i.e. no browser). */
-class ConsoleFileSystem implements FileSystem {
-
- /** Pending futures for file write requests. */
- final _pending = <String, Future>{};
-
- Future flush() => Future.wait(_pending.values.toList());
-
- void writeString(String path, String text) {
- if(!_pending.containsKey(path)) {
- _pending[path] = new File(path).open(mode: FileMode.WRITE)
- .then((file) => file.writeString(text))
- .then((file) => file.close())
- .whenComplete(() { _pending.remove(path); });
- }
- }
-
- // TODO(jmesserly): even better would be to pass the RandomAccessFile directly
- // to html5lib. This will require a further restructuring of FileSystem.
- // Probably it just needs "readHtml" and "readText" methods.
- Future<List<int>> readTextOrBytes(String path) {
- return new File(path).open().then(
- (file) => file.length().then((length) {
- // TODO(jmesserly): is this guaranteed to read all of the bytes?
- var buffer = new List<int>(length);
- return file.readInto(buffer, 0, length)
- .then((_) => file.close())
- .then((_) => buffer);
- }));
- }
-
- // TODO(jmesserly): do we support any encoding other than UTF-8 for Dart?
- Future<String> readText(String path) {
- return readTextOrBytes(path).then(UTF8.decode);
- }
-}
« no previous file with comments | « pkg/polymer/lib/src/file_system.dart ('k') | pkg/polymer/lib/src/files.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698