| OLD | NEW |
| 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 | 13 |
| 14 import '../exceptions.dart'; |
| 14 import '../http.dart'; | 15 import '../http.dart'; |
| 15 import '../io.dart'; | 16 import '../io.dart'; |
| 16 import '../log.dart' as log; | 17 import '../log.dart' as log; |
| 17 import '../package.dart'; | 18 import '../package.dart'; |
| 18 import '../pubspec.dart'; | 19 import '../pubspec.dart'; |
| 19 import '../utils.dart'; | 20 import '../utils.dart'; |
| 20 import '../version.dart'; | 21 import '../version.dart'; |
| 21 import 'cached.dart'; | 22 import 'cached.dart'; |
| 22 | 23 |
| 23 /// 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 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 var name = description["name"]; | 354 var name = description["name"]; |
| 354 if (name is! String) { | 355 if (name is! String) { |
| 355 throw new FormatException("The 'name' key must have a string value."); | 356 throw new FormatException("The 'name' key must have a string value."); |
| 356 } | 357 } |
| 357 | 358 |
| 358 var url = description["url"]; | 359 var url = description["url"]; |
| 359 if (url == null) url = HostedSource.defaultUrl; | 360 if (url == null) url = HostedSource.defaultUrl; |
| 360 | 361 |
| 361 return new Pair<String, String>(name, url); | 362 return new Pair<String, String>(name, url); |
| 362 } | 363 } |
| OLD | NEW |