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:json' as json; | 9 import 'dart:json' as json; |
10 | 10 |
11 import 'package:http/http.dart' as http; | 11 import 'package:http/http.dart' as http; |
12 import 'package:pathos/path.dart' as path; | 12 import 'package:path/path.dart' as path; |
13 | 13 |
14 import '../http.dart'; | 14 import '../http.dart'; |
15 import '../io.dart'; | 15 import '../io.dart'; |
16 import '../log.dart' as log; | 16 import '../log.dart' as log; |
17 import '../package.dart'; | 17 import '../package.dart'; |
18 import '../pubspec.dart'; | 18 import '../pubspec.dart'; |
19 import '../source.dart'; | 19 import '../source.dart'; |
20 import '../source_registry.dart'; | 20 import '../source_registry.dart'; |
21 import '../utils.dart'; | 21 import '../utils.dart'; |
22 import '../version.dart'; | 22 import '../version.dart'; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 var name = description["name"]; | 253 var name = description["name"]; |
254 if (name is! String) { | 254 if (name is! String) { |
255 throw new FormatException("The 'name' key must have a string value."); | 255 throw new FormatException("The 'name' key must have a string value."); |
256 } | 256 } |
257 | 257 |
258 var url = description["url"]; | 258 var url = description["url"]; |
259 if (url == null) url = HostedSource.DEFAULT_URL; | 259 if (url == null) url = HostedSource.DEFAULT_URL; |
260 | 260 |
261 return new Pair<String, String>(name, url); | 261 return new Pair<String, String>(name, url); |
262 } | 262 } |
OLD | NEW |