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 hosted_source; | 5 library hosted_source; |
6 | 6 |
7 import 'dart:io' as io; | 7 import 'dart:io' as io; |
8 import 'dart:json'; | 8 import 'dart:json'; |
9 import 'dart:uri'; | 9 import 'dart:uri'; |
10 | 10 |
11 // TODO(nweiz): Make this import better. | 11 // TODO(nweiz): Make this import better. |
12 import '../../pkg/http/lib/http.dart' as http; | 12 import '../../pkg/http/lib/http.dart' as http; |
| 13 import 'http.dart'; |
13 import 'io.dart'; | 14 import 'io.dart'; |
14 import 'log.dart' as log; | 15 import 'log.dart' as log; |
15 import 'package.dart'; | 16 import 'package.dart'; |
16 import 'pubspec.dart'; | 17 import 'pubspec.dart'; |
17 import 'source.dart'; | 18 import 'source.dart'; |
18 import 'source_registry.dart'; | 19 import 'source_registry.dart'; |
19 import 'utils.dart'; | 20 import 'utils.dart'; |
20 import 'version.dart'; | 21 import 'version.dart'; |
21 | 22 |
22 /** | 23 /** |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 170 |
170 var name = description["name"]; | 171 var name = description["name"]; |
171 if (name is! String) { | 172 if (name is! String) { |
172 throw new FormatException("The 'name' key must have a string value."); | 173 throw new FormatException("The 'name' key must have a string value."); |
173 } | 174 } |
174 | 175 |
175 var url = description.containsKey("url") ? description["url"] : defaultUrl; | 176 var url = description.containsKey("url") ? description["url"] : defaultUrl; |
176 return new Pair<String, String>(name, url); | 177 return new Pair<String, String>(name, url); |
177 } | 178 } |
178 } | 179 } |
OLD | NEW |