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

Unified Diff: utils/tests/pub/descriptor/tar.dart

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 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 | « utils/tests/pub/descriptor/git.dart ('k') | utils/tests/pub/dev_dependency_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/descriptor/tar.dart
diff --git a/utils/tests/pub/descriptor/tar.dart b/utils/tests/pub/descriptor/tar.dart
deleted file mode 100644
index c4f1d8fcafc0e12a103552bc65016f17c30c3b60..0000000000000000000000000000000000000000
--- a/utils/tests/pub/descriptor/tar.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// 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.
-
-library descriptor.tar;
-
-import 'dart:io';
-import 'dart:async';
-
-import 'package:pathos/path.dart' as path;
-import 'package:scheduled_test/scheduled_test.dart';
-import 'package:scheduled_test/descriptor.dart';
-
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
-
-/// Describes a tar file and its contents.
-class TarFileDescriptor extends DirectoryDescriptor {
- TarFileDescriptor(String name, List<Descriptor> contents)
- : super(name, contents);
-
- /// Creates the files and directories within this tar file, then archives
- /// them, compresses them, and saves the result to [parentDir].
- Future<String> create([String parent]) => schedule(() {
- if (parent == null) parent = defaultRoot;
- return withTempDir((tempDir) {
- return Future.wait(contents.map((entry) {
- return entry.create(tempDir);
- })).then((_) {
- var createdContents = listDir(tempDir,
- recursive: true,
- includeHidden: true);
- return createTarGz(createdContents, baseDir: tempDir).toBytes();
- }).then((bytes) {
- var file = path.join(parent, name);
- writeBinaryFile(file, bytes);
- return file;
- });
- });
- }, 'creating tar file:\n${describe()}');
-
- /// Validates that the `.tar.gz` file at [path] contains the expected
- /// contents.
- Future validate([String parent]) {
- throw new UnimplementedError("TODO(nweiz): implement this");
- }
-
- Stream<List<int>> read() {
- return new Stream<List<int>>.fromFuture(withTempDir((tempDir) {
- return create(tempDir).then((_) =>
- readBinaryFile(path.join(tempDir, name)));
- }));
- }
-}
« no previous file with comments | « utils/tests/pub/descriptor/git.dart ('k') | utils/tests/pub/dev_dependency_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698