You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

treevisitor

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

treevisitor

0.2.5
bundlerRubygems
Version published
Maintainers
1
Created
Source

tree.rb / tree visitor library

Project is moved to new gem tree.rb (https://rubygems.org/gems/tree.rb/stats) and new repository (https://github.com/tokiro/tree.rb)

tree.rb is a 'clone' of tree unix command. It is based on tree visitor library. Tree visitor is an implementation of visitor design pattern.

 $ tree.rb lib

  lib
 |-- tree_visitor.rb
 |-- treevisitor.rb
 |-- treevisitor_cli.rb
 `-- treevisitor
     |-- abs_node.rb
     |-- dir_processor.rb
     |-- dir_tree_walker.rb
     |-- leaf_node.rb
     |-- tree_node.rb
     |-- tree_node_visitor.rb
     |-- cli
     |   `-- cli_tree.rb
     `-- visitors
         |-- block_tree_node_visitor.rb
         |-- build_dir_tree_visitor.rb
         |-- callback_tree_node_visitor2.rb
         |-- clone_tree_node_visitor.rb
         |-- depth_tree_node_visitor.rb
         |-- flat_print_tree_node_visitors.rb
         |-- print_dir_tree_visitor.rb
         `-- print_tree_node_visitor.rb

The tree.rb can generate json structure suitable to be visualized with protovis javascript library. See the examples directory.

$ ruby bin/tree.rb --format json lib

{
  "lib": {
    "tree_visitor.rb": 45,
    "treevisitor": {
      "abs_node.rb": 2858,
      "basic_tree_node_visitor.rb": 578,
      "cli": {
        "cli_tree.rb": 2929
      },
      "directory_walker.rb": 5049,
      "leaf_node.rb": 526,
      "tree_node.rb": 5665,
      "tree_node_visitor.rb": 1263,
      "util": {
        "dir_processor.rb": 928
      },
      "visitors": {
        "block_tree_node_visitor.rb": 386,
        "build_dir_tree_visitor.rb": 1167,
        "callback_tree_node_visitor2.rb": 1652,
        "clone_tree_node_visitor.rb": 837,
        "depth_tree_node_visitor.rb": 427,
        "directory_to_hash_visitor.rb": 639,
        "flat_print_tree_node_visitors.rb": 341,
        "print_dir_tree_visitor.rb": 387,
        "print_tree_node_visitor.rb": 707
      }
    },
    "treevisitor.rb": 976,
    "treevisitor_cli.rb": 87
  }

The json structure can be transformed into image:

Documentation

http://rubydoc.info/gems/treevisitor

Try tree.rb -h to get help on command line. See examples directory to use treevisitor in your code.

INSTALL:

sudo gem install treevisitor

Contributions

Everybody is welcome to contribute to this project by commenting the source code, suggesting modifications or new ideas, reporting bugs, writing some documentation and, of course, you're also welcome to contribute with patches as well!

Rubies

This gem have been tested on MRI 1.9.2.

Copyright (c) 2009-2011 tokiro.oyama@gmail.com. See LICENSE for details.

FAQs

Package last updated on 19 Aug 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.