Class: Lapidarius::Tree

Inherits:
Object
  • Object
show all
Defined in:
lib/lapidarius/tree.rb

Constant Summary collapse

CURVED =
"└── "
EMPTY =
"    "
NESTED =
"├── "
STRAIGHT =
"│   "

Instance Method Summary collapse

Constructor Details

#initialize(gem) ⇒ Tree

Returns a new instance of Tree.



10
11
12
13
# File 'lib/lapidarius/tree.rb', line 10

def initialize(gem)
  @gem = gem
  @out = []
end

Instance Method Details

#outObject



15
16
17
18
19
20
21
22
23
# File 'lib/lapidarius/tree.rb', line 15

def out
  return @out unless @out.empty?
  @out.tap do |out|
    out << @gem
    recurse
    out << ""
    out << "#{@gem.count} runtime dependencies"
  end
end