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 /// A simple library for rendering a list of files as a directory tree. | 5 /// A simple library for rendering a list of files as a directory tree. |
6 library pub.directory_tree; | 6 library pub.directory_tree; |
7 | 7 |
8 import 'package:path/path.dart' as path; | 8 import 'package:path/path.dart' as path; |
9 | 9 |
10 import 'log.dart' as log; | |
11 | |
12 /// Draws a directory tree for the given list of files. Given a list of files | 10 /// Draws a directory tree for the given list of files. Given a list of files |
13 /// like: | 11 /// like: |
14 /// | 12 /// |
15 /// TODO | 13 /// TODO |
16 /// example/console_example.dart | 14 /// example/console_example.dart |
17 /// example/main.dart | 15 /// example/main.dart |
18 /// example/web copy/web_example.dart | 16 /// example/web copy/web_example.dart |
19 /// test/absolute_test.dart | 17 /// test/absolute_test.dart |
20 /// test/basename_test.dart | 18 /// test/basename_test.dart |
21 /// test/dirname_test.dart | 19 /// test/dirname_test.dart |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 buffer.write(prefix); | 124 buffer.write(prefix); |
127 buffer.write(_getPrefix(name == null, isLast)); | 125 buffer.write(_getPrefix(name == null, isLast)); |
128 buffer.writeln('| (${childNames.length - 6} more...)'); | 126 buffer.writeln('| (${childNames.length - 6} more...)'); |
129 | 127 |
130 // Show the last few. | 128 // Show the last few. |
131 _drawChild(false, childNames[childNames.length - 3]); | 129 _drawChild(false, childNames[childNames.length - 3]); |
132 _drawChild(false, childNames[childNames.length - 2]); | 130 _drawChild(false, childNames[childNames.length - 2]); |
133 _drawChild(true, childNames[childNames.length - 1]); | 131 _drawChild(true, childNames[childNames.length - 1]); |
134 } | 132 } |
135 } | 133 } |
OLD | NEW |