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

Side by Side Diff: sdk/lib/_internal/pub/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 // 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 pub.source.hosted; 5 library pub.source.hosted;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 import "dart:convert"; 9 import "dart:convert";
10 10
11 import 'package:http/http.dart' as http; 11 import 'package:http/http.dart' as http;
12 import 'package:path/path.dart' as path; 12 import 'package:path/path.dart' as path;
13 import 'package:pub_semver/pub_semver.dart';
13 14
14 import '../exceptions.dart'; 15 import '../exceptions.dart';
15 import '../http.dart'; 16 import '../http.dart';
16 import '../io.dart'; 17 import '../io.dart';
17 import '../log.dart' as log; 18 import '../log.dart' as log;
18 import '../package.dart'; 19 import '../package.dart';
19 import '../pubspec.dart'; 20 import '../pubspec.dart';
20 import '../utils.dart'; 21 import '../utils.dart';
21 import '../version.dart';
22 import 'cached.dart'; 22 import 'cached.dart';
23 23
24 /// A package source that gets packages from a package hosting site that uses 24 /// A package source that gets packages from a package hosting site that uses
25 /// the same API as pub.dartlang.org. 25 /// the same API as pub.dartlang.org.
26 class HostedSource extends CachedSource { 26 class HostedSource extends CachedSource {
27 final name = "hosted"; 27 final name = "hosted";
28 final hasMultipleVersions = true; 28 final hasMultipleVersions = true;
29 29
30 /// Gets the default URL for the package server for hosted dependencies. 30 /// Gets the default URL for the package server for hosted dependencies.
31 static String get defaultUrl { 31 static String get defaultUrl {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 var name = description["name"]; 355 var name = description["name"];
356 if (name is! String) { 356 if (name is! String) {
357 throw new FormatException("The 'name' key must have a string value."); 357 throw new FormatException("The 'name' key must have a string value.");
358 } 358 }
359 359
360 var url = description["url"]; 360 var url = description["url"];
361 if (url == null) url = HostedSource.defaultUrl; 361 if (url == null) url = HostedSource.defaultUrl;
362 362
363 return new Pair<String, String>(name, url); 363 return new Pair<String, String>(name, url);
364 } 364 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/source.dart ('k') | sdk/lib/_internal/pub/lib/src/validator/dependency.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698