OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 library path_source; | |
6 | |
7 import 'dart:async'; | |
8 import 'io.dart'; | |
9 import 'package.dart'; | |
10 import 'pubspec.dart'; | |
11 import 'version.dart'; | |
12 import 'source.dart'; | |
13 import 'dart:io'; | |
14 | |
15 | |
16 /// A package source that installs packages from disk for development use | |
Bob Nystrom
2013/01/17 19:15:10
Add a "." to make this a full sentence. Also inste
Sam E
2013/01/20 04:16:57
Done.
Sam E
2013/01/20 04:16:57
Done.
| |
17 class PathSource extends Source { | |
18 final String name = 'path'; | |
19 final bool shouldCache = false; | |
Bob Nystrom
2013/01/17 19:15:10
Type annotations aren't needed for final fields, s
Sam E
2013/01/20 04:16:57
Done.
| |
20 | |
21 PathSource(); | |
Bob Nystrom
2013/01/17 19:15:10
I think you can remove this if it doesn't do anyth
Sam E
2013/01/20 04:16:57
Done.
| |
22 | |
23 Future<Pubspec> describe(PackageId id) => | |
24 Package.load(id.name, id.description, systemCache.sources).then( | |
25 (pkg) => pkg.pubspec); | |
26 | |
27 Future<bool> install(PackageId id, String path) => | |
28 createPackageSymlink(id.name, id.description, path).then((_) => true); | |
29 | |
30 void validateDescription(description, {bool fromLockFile: false}) { | |
31 if (description is String) return; | |
32 throw new FormatException("The description must be a path string"); | |
Bob Nystrom
2013/01/17 19:15:10
How about flipping this logic around and using if
Sam E
2013/01/20 04:16:57
Done.
| |
33 } | |
34 } | |
OLD | NEW |