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

Side by Side Diff: utils/pub/io.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 1 month 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
« no previous file with comments | « utils/pub/git_source.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * Helper functionality to make working with IO easier. 6 * Helper functionality to make working with IO easier.
7 */ 7 */
8 library io; 8 library io;
9 9
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 if (workingDir != null) { 499 if (workingDir != null) {
500 options.workingDirectory = _getDirectory(workingDir).path; 500 options.workingDirectory = _getDirectory(workingDir).path;
501 } 501 }
502 options.environment = environment; 502 options.environment = environment;
503 503
504 var future = Process.run(executable, args, options); 504 var future = Process.run(executable, args, options);
505 return future.transform((result) { 505 return future.transform((result) {
506 // TODO(rnystrom): Remove this and change to returning one string. 506 // TODO(rnystrom): Remove this and change to returning one string.
507 List<String> toLines(String output) { 507 List<String> toLines(String output) {
508 var lines = output.split(NEWLINE_PATTERN); 508 var lines = output.split(NEWLINE_PATTERN);
509 if (!lines.isEmpty() && lines.last() == "") lines.removeLast(); 509 if (!lines.isEmpty && lines.last() == "") lines.removeLast();
510 return lines; 510 return lines;
511 } 511 }
512 return new PubProcessResult(toLines(result.stdout), 512 return new PubProcessResult(toLines(result.stdout),
513 toLines(result.stderr), 513 toLines(result.stderr),
514 result.exitCode); 514 result.exitCode);
515 }); 515 });
516 } 516 }
517 517
518 /** 518 /**
519 * Wraps [input] to provide a timeout. If [input] completes before 519 * Wraps [input] to provide a timeout. If [input] completes before
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 return new Directory(entry); 748 return new Directory(entry);
749 } 749 }
750 750
751 /** 751 /**
752 * Gets a [Uri] for [uri], which can either already be one, or be a [String]. 752 * Gets a [Uri] for [uri], which can either already be one, or be a [String].
753 */ 753 */
754 Uri _getUri(uri) { 754 Uri _getUri(uri) {
755 if (uri is Uri) return uri; 755 if (uri is Uri) return uri;
756 return new Uri.fromString(uri); 756 return new Uri.fromString(uri);
757 } 757 }
OLDNEW
« no previous file with comments | « utils/pub/git_source.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698