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

Side by Side Diff: sdk/lib/_internal/pub_generated/lib/src/source/hosted.dart

Issue 602253002: Use pub_semver package in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
OLDNEW
1 library pub.source.hosted; 1 library pub.source.hosted;
2 import 'dart:async'; 2 import 'dart:async';
3 import 'dart:io' as io; 3 import 'dart:io' as io;
4 import "dart:convert"; 4 import "dart:convert";
5 import 'package:http/http.dart' as http; 5 import 'package:http/http.dart' as http;
6 import 'package:path/path.dart' as path; 6 import 'package:path/path.dart' as path;
7 import 'package:pub_semver/pub_semver.dart';
7 import '../exceptions.dart'; 8 import '../exceptions.dart';
8 import '../http.dart'; 9 import '../http.dart';
9 import '../io.dart'; 10 import '../io.dart';
10 import '../log.dart' as log; 11 import '../log.dart' as log;
11 import '../package.dart'; 12 import '../package.dart';
12 import '../pubspec.dart'; 13 import '../pubspec.dart';
13 import '../utils.dart'; 14 import '../utils.dart';
14 import '../version.dart';
15 import 'cached.dart'; 15 import 'cached.dart';
16 class HostedSource extends CachedSource { 16 class HostedSource extends CachedSource {
17 final name = "hosted"; 17 final name = "hosted";
18 final hasMultipleVersions = true; 18 final hasMultipleVersions = true;
19 static String get defaultUrl { 19 static String get defaultUrl {
20 var url = io.Platform.environment["PUB_HOSTED_URL"]; 20 var url = io.Platform.environment["PUB_HOSTED_URL"];
21 if (url != null) return url; 21 if (url != null) return url;
22 return "https://pub.dartlang.org"; 22 return "https://pub.dartlang.org";
23 } 23 }
24 Future<List<Version>> getVersions(String name, description) { 24 Future<List<Version>> getVersions(String name, description) {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 throw new FormatException("The description map must contain a 'name' key."); 229 throw new FormatException("The description map must contain a 'name' key.");
230 } 230 }
231 var name = description["name"]; 231 var name = description["name"];
232 if (name is! String) { 232 if (name is! String) {
233 throw new FormatException("The 'name' key must have a string value."); 233 throw new FormatException("The 'name' key must have a string value.");
234 } 234 }
235 var url = description["url"]; 235 var url = description["url"];
236 if (url == null) url = HostedSource.defaultUrl; 236 if (url == null) url = HostedSource.defaultUrl;
237 return new Pair<String, String>(name, url); 237 return new Pair<String, String>(name, url);
238 } 238 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub_generated/lib/src/source.dart ('k') | sdk/lib/_internal/pub_generated/lib/src/validator/dependency.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698