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: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 import 'dart:uri'; | 10 import 'dart:uri'; |
11 | 11 |
12 // TODO(nweiz): Make this import better. | 12 // TODO(nweiz): Make this import better. |
13 import '../../pkg/http/lib/http.dart' as http; | 13 import '../../pkg/http/lib/http.dart' as http; |
14 import '../../pkg/path/lib/path.dart' as path; | 14 import '../../pkg/pathos/lib/path.dart' as path; |
15 | 15 |
16 import 'http.dart'; | 16 import 'http.dart'; |
17 import 'io.dart'; | 17 import 'io.dart'; |
18 import 'log.dart' as log; | 18 import 'log.dart' as log; |
19 import 'package.dart'; | 19 import 'package.dart'; |
20 import 'pubspec.dart'; | 20 import 'pubspec.dart'; |
21 import 'source.dart'; | 21 import 'source.dart'; |
22 import 'source_registry.dart'; | 22 import 'source_registry.dart'; |
23 import 'utils.dart'; | 23 import 'utils.dart'; |
24 import 'version.dart'; | 24 import 'version.dart'; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } | 187 } |
188 | 188 |
189 var name = description["name"]; | 189 var name = description["name"]; |
190 if (name is! String) { | 190 if (name is! String) { |
191 throw new FormatException("The 'name' key must have a string value."); | 191 throw new FormatException("The 'name' key must have a string value."); |
192 } | 192 } |
193 | 193 |
194 var url = description.containsKey("url") ? description["url"] : _defaultUrl; | 194 var url = description.containsKey("url") ? description["url"] : _defaultUrl; |
195 return new Pair<String, String>(name, url); | 195 return new Pair<String, String>(name, url); |
196 } | 196 } |
OLD | NEW |