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

Unified Diff: lib/src/source/unknown.dart

Issue 1528523003: Clean up the semantics of package descriptions. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years 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/source/path.dart ('k') | lib/src/system_cache.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/source/unknown.dart
diff --git a/lib/src/source/unknown.dart b/lib/src/source/unknown.dart
index fd76829042dca456e87e3ced10e5fb3d9d725a77..4a8f361a1f3bc74e95da520a819d52ce62454307 100644
--- a/lib/src/source/unknown.dart
+++ b/lib/src/source/unknown.dart
@@ -6,6 +6,8 @@ library pub.source.unknown;
import 'dart:async';
+import 'package:pub_semver/pub_semver.dart';
+
import '../package.dart';
import '../pubspec.dart';
import '../source.dart';
@@ -28,6 +30,10 @@ class UnknownSource extends Source {
int get hashCode => name.hashCode;
+ Future<List<PackageId>> doGetVersions(PackageRef ref) =>
+ throw new UnsupportedError(
+ "Cannot get package versions from unknown source '$name'.");
+
Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError(
"Cannot describe a package from unknown source '$name'.");
@@ -41,7 +47,9 @@ class UnknownSource extends Source {
bool descriptionsEqual(description1, description2) =>
description1 == description2;
- /// Unknown sources do no validation.
- dynamic parseDescription(String containingPath, description,
- {bool fromLockFile: false}) => description;
+ PackageRef parseRef(String name, description, {String containingPath}) =>
+ new PackageRef(name, this.name, description);
+
+ PackageId parseId(String name, Version version, description) =>
+ new PackageId(name, this.name, version, description);
}
« no previous file with comments | « lib/src/source/path.dart ('k') | lib/src/system_cache.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698