Closed nightscape closed 5 years ago
@nightscape This is a great start. I agree this extension will be much more useful and portable if the tree is created using Ruby.
Here are a few things that need to be changed in order for it to match the original behavior:
I recommend generating a tree using the tree command so that you can compare the result. Also be sure to test an absolute path, not just a relative one.
I pushed another commit to the PR that implements the features listed in my previous comment. Give it a try and see if you like it. If so, we can proceed with merging.
I do wonder if we should still provide an option to use the tree command. I can't really see a benefit to keeping that code since it's a) system dependent, b) required a lot of hacking of the output, and c) doesn't add any value. Would you agree we should just stick with a pure Ruby approach?
I'm going to go ahead and proceed with the merge. If there are any changes you'd like to make, feel free to follow-up with another PR.
I tried to use the tree block macro inside the official asciidoctor Docker image, but that unfortunately doesn't have the tree command. I created a pure Ruby version for listing files, but it might not yet match the original output as I didn't fully understand the interplay between the
tree
command and thegsub
s. I'd be thankful for any pointers of what to improve :smiley: