Redwood: Ruby Trees
redwoodcommand-line tool: a Ruby hack/rewrite of the Unix
- A Module providing tree-like methods for your objects.
Redwood::Nodeclass as a basic implementation of tree creation.
Redwood::FileNodeclass for representing directories in a tree-like way.
gem install redwood to get started.
My favorite thing about Redwood is that you get the awesome tree view for all of the tree objects that mix-in
Redwood |-- bin | `-- redwood |-- Gemfile |-- lib | |-- redwood | | |-- filenode.rb | | `-- node.rb | `-- redwood.rb |-- LICENSE |-- pkg | `-- redwood-0.0.1.gem |-- Rakefile |-- README.md |-- redwood.gemspec `-- test |-- helper.rb `-- test_redwood.rb
Redwood was created mostly to facilitate this kind of thing, and as a bit of a brain-teaser. The
redwood CLI is, honestly, totally inferior to the original
tree (written in C). I was getting frustrated working on Prism, and I created Redwood to get my mind wrapped around the concept of tree structures. While there are several implementations of tree data-structures in Ruby, I wasn’t really impressed with any of their APIs. And none of them created the tree-view that you get with the
Redwood began life as a thought-experiment and I hope you are able to use it whenever you need something resembling a tree.