OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.unknown; | 5 library pub.source.unknown; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import '../package.dart'; | 9 import '../package.dart'; |
10 import '../pubspec.dart'; | 10 import '../pubspec.dart'; |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 int get hashCode => name.hashCode; | 29 int get hashCode => name.hashCode; |
30 | 30 |
31 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( | 31 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( |
32 "Cannot describe a package from unknown source '$name'."); | 32 "Cannot describe a package from unknown source '$name'."); |
33 | 33 |
34 Future get(PackageId id, String symlink) => throw new UnsupportedError( | 34 Future get(PackageId id, String symlink) => throw new UnsupportedError( |
35 "Cannot get an unknown source '$name'."); | 35 "Cannot get an unknown source '$name'."); |
36 | 36 |
37 /// Returns the directory where this package can be found locally. | 37 /// Returns the directory where this package can be found locally. |
38 Future<String> getDirectory(PackageId id) => throw new UnsupportedError( | 38 String getDirectory(PackageId id) => throw new UnsupportedError( |
39 "Cannot find a package from an unknown source '$name'."); | 39 "Cannot find a package from an unknown source '$name'."); |
40 | 40 |
41 bool descriptionsEqual(description1, description2) => | 41 bool descriptionsEqual(description1, description2) => |
42 description1 == description2; | 42 description1 == description2; |
43 | 43 |
44 /// Unknown sources do no validation. | 44 /// Unknown sources do no validation. |
45 dynamic parseDescription(String containingPath, description, | 45 dynamic parseDescription(String containingPath, description, |
46 {bool fromLockFile: false}) => description; | 46 {bool fromLockFile: false}) => description; |
47 } | 47 } |
OLD | NEW |