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

Unified Diff: sdk/lib/_internal/pub/lib/src/package.dart

Issue 16034002: Use helper methods for running pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Get rid of unnecessary RegExps in tests. Created 7 years, 7 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
Index: sdk/lib/_internal/pub/lib/src/package.dart
diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart
index a2a1b128f8e88535ace4b8ed25ae81ee3aea97e0..22d3bee615321f30614c7ceb2bf31dcf5ea6bda9 100644
--- a/sdk/lib/_internal/pub/lib/src/package.dart
+++ b/sdk/lib/_internal/pub/lib/src/package.dart
@@ -11,6 +11,7 @@ import 'package:pathos/path.dart' as path;
import 'io.dart';
import 'pubspec.dart';
import 'source_registry.dart';
+import 'utils.dart';
import 'version.dart';
final _README_REGEXP = new RegExp(r"^README($|\.)", caseSensitive: false);
@@ -190,29 +191,30 @@ class PackageDep extends _PackageName {
}
}
-class PubspecNotFoundException implements Exception {
+class PubspecNotFoundException extends ApplicationException {
final String name;
- PubspecNotFoundException(this.name);
-
- String toString() => 'Package "$name" doesn\'t have a pubspec.yaml file.';
+ PubspecNotFoundException(String name)
+ : name = name,
+ super('Package "$name" doesn\'t have a pubspec.yaml file.');
}
-class PubspecHasNoNameException implements Exception {
+class PubspecHasNoNameException extends ApplicationException {
final String name;
- PubspecHasNoNameException(this.name);
-
- String toString() => 'Package "$name"\'s pubspec.yaml file is missing the '
- 'required "name" field (e.g. "name: $name").';
+ PubspecHasNoNameException(String name)
+ : name = name,
+ super('Package "$name"\'s pubspec.yaml file is missing the '
+ 'required "name" field (e.g. "name: $name").');
}
-class PubspecNameMismatchException implements Exception {
+class PubspecNameMismatchException extends ApplicationException {
final String expectedName;
final String actualName;
- PubspecNameMismatchException(this.expectedName, this.actualName);
-
- String toString() => 'The name you specified for your dependency, '
- '"$expectedName", doesn\'t match the name "$actualName" in its pubspec.';
+ PubspecNameMismatchException(String expectedName, String actualName)
+ : expectedName = expectedName,
+ actualName = actualName,
+ super('The name you specified for your dependency, "$expectedName", '
+ 'doesn\'t match the name "$actualName" in its pubspec.');
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command.dart ('k') | sdk/lib/_internal/pub/lib/src/solver/version_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698