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

Unified Diff: utils/pub/package.dart

Issue 10174029: Use YAML as the format for the pubspec file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « no previous file | utils/pub/pub.dart » ('j') | utils/tests/pub/pub_tests.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/package.dart
diff --git a/utils/pub/package.dart b/utils/pub/package.dart
index 0b1bcfa2d36dc32c3e19cc34e396f4a8df3ffec1..79ddd52001590e620e27dd7a4bf2d40307b3a0e6 100644
--- a/utils/pub/package.dart
+++ b/utils/pub/package.dart
@@ -113,13 +113,13 @@ class Package implements Hashable {
});
readFuture.then((pubspec) {
- // TODO(rnystrom): Use YAML parser when ready. For now, it's just a flat
- // list of newline-separated strings.
- final dependencyNames = pubspec.split('\n').
- map((name) => name.trim()).
- filter((name) => (name != null) && (name != ''));
+ var parsedPubspec = loadYaml(pubspec);
+ if (parsedPubspec is! List || parsedPubspec.some((e) => e is! String)) {
+ completer.completeException(
+ 'pubspec must be a YAML list of package names.');
Bob Nystrom 2012/04/25 22:59:01 'The pubspec... just so it can be sentence cased.
nweiz 2012/04/25 23:05:14 Done.
+ }
- completer.complete(dependencyNames);
+ completer.complete(parsedPubspec);
});
return completer.future;
« no previous file with comments | « no previous file | utils/pub/pub.dart » ('j') | utils/tests/pub/pub_tests.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698