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

Unified Diff: lib/src/source.dart

Issue 1276673006: Make Source.getDirectory synchronous. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 4 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 | « lib/src/global_packages.dart ('k') | lib/src/source/cached.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/source.dart
diff --git a/lib/src/source.dart b/lib/src/source.dart
index 85218d349791722d4552b8c3c3eafa9298dd3338..e49b17f737a4cfda1ef444b231f2bb912751e47f 100644
--- a/lib/src/source.dart
+++ b/lib/src/source.dart
@@ -107,10 +107,10 @@ abstract class Source {
/// Returns the directory where this package can (or could) be found locally.
///
- /// If the source is cached, this will be a path in the system cache. In that
- /// case, this will return a directory even if the package has not been
- /// installed into the cache yet.
- Future<String> getDirectory(PackageId id);
+ /// If the source is cached, this will be a path in the system cache.
+ /// Depending on the source, this may throw an [ArgumentError] if [id] isn't
+ /// resolved using [resolveId].
+ String getDirectory(PackageId id);
/// Gives the source a chance to interpret and validate the description for
/// a package coming from this source.
@@ -182,6 +182,9 @@ abstract class Source {
/// By default, this just returns [id].
Future<PackageId> resolveId(PackageId id) => new Future.value(id);
+ /// Returns whether [id] is fully-resolved, according to [resolveId].
+ bool isResolved(PackageId id) => true;
+
/// Returns the source's name.
String toString() => name;
}
« no previous file with comments | « lib/src/global_packages.dart ('k') | lib/src/source/cached.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698