Class: CobraCommander::Output::AsciiTree
- Inherits:
-
Object
- Object
- CobraCommander::Output::AsciiTree
- Defined in:
- lib/cobra_commander/output/ascii_tree.rb
Overview
Prints the tree in a nice tree form
Constant Summary collapse
- SPACE =
" "- BAR =
"│ "- TEE =
"├── "- CORNER =
"└── "
Instance Method Summary collapse
-
#initialize(component) ⇒ AsciiTree
constructor
A new instance of AsciiTree.
- #to_s ⇒ Object
Constructor Details
#initialize(component) ⇒ AsciiTree
Returns a new instance of AsciiTree.
14 15 16 |
# File 'lib/cobra_commander/output/ascii_tree.rb', line 14 def initialize(component) @component = component end |
Instance Method Details
#to_s ⇒ Object
18 19 20 21 22 23 |
# File 'lib/cobra_commander/output/ascii_tree.rb', line 18 def to_s StringIO.new.tap do |io| io.puts @component.name list_dependencies(io, @component) end.string end |