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

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

Issue 10690032: Make VersionSolver source- and description-aware. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/pub/package.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 #library('git_source'); 5 #library('git_source');
6 6
7 #import('io.dart'); 7 #import('io.dart');
8 #import('package.dart'); 8 #import('package.dart');
9 #import('source.dart'); 9 #import('source.dart');
10 #import('utils.dart'); 10 #import('utils.dart');
(...skipping 29 matching lines...) Expand all
40 "Cannot install '${id.name}' from Git (${id.description}).\n" 40 "Cannot install '${id.name}' from Git (${id.description}).\n"
41 "Please ensure Git is correctly installed."); 41 "Please ensure Git is correctly installed.");
42 } 42 }
43 }); 43 });
44 } 44 }
45 45
46 /** 46 /**
47 * The package name of a Git repo is the name of the directory into which 47 * The package name of a Git repo is the name of the directory into which
48 * it'll be cloned. 48 * it'll be cloned.
49 */ 49 */
50 String packageName(PackageId id) => 50 String packageName(description) =>
51 basename(id.description).replaceFirst(const RegExp("\.git\$"), ""); 51 basename(description).replaceFirst(const RegExp("\.git\$"), "");
52 52
53 /** 53 /**
54 * Ensures [description] is a Git URL. 54 * Ensures [description] is a Git URL.
55 */ 55 */
56 void validateDescription(description) { 56 void validateDescription(description) {
57 if (description is! String) { 57 if (description is! String) {
58 throw new FormatException("The description must be a git URL."); 58 throw new FormatException("The description must be a git URL.");
59 } 59 }
60 } 60 }
61 } 61 }
OLDNEW
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/pub/package.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698