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 tree-like structures in ASCII. | 5 /// A simple library for rendering tree-like structures in ASCII. |
6 library pub.ascii_tree; | |
7 | |
8 import 'package:path/path.dart' as path; | 6 import 'package:path/path.dart' as path; |
9 | 7 |
10 import 'log.dart' as log; | 8 import 'log.dart' as log; |
11 import 'utils.dart'; | 9 import 'utils.dart'; |
12 | 10 |
13 /// Draws a tree for the given list of files. Given files like: | 11 /// Draws a tree for the given list of files. Given files 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 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 buffer.write(prefix); | 156 buffer.write(prefix); |
159 buffer.write(_getPrefix(name == null, isLast)); | 157 buffer.write(_getPrefix(name == null, isLast)); |
160 buffer.writeln(log.gray('| (${childNames.length - 6} more...)')); | 158 buffer.writeln(log.gray('| (${childNames.length - 6} more...)')); |
161 | 159 |
162 // Show the last few. | 160 // Show the last few. |
163 drawChild(false, childNames[childNames.length - 3]); | 161 drawChild(false, childNames[childNames.length - 3]); |
164 drawChild(false, childNames[childNames.length - 2]); | 162 drawChild(false, childNames[childNames.length - 2]); |
165 drawChild(true, childNames[childNames.length - 1]); | 163 drawChild(true, childNames[childNames.length - 1]); |
166 } | 164 } |
167 } | 165 } |
OLD | NEW |