Inversion::CLI::

TreeCommand module

Tree command

Public Instance Methods

dump_node_trees( templates )

Dump the node tree of the given ‘templates`.

# File lib/inversion/cli/tree.rb, line 49
def dump_node_trees( templates )
        templates.each do |path|
                template = self.load_template( path )
                self.output_blank_line
                self.output_template_header( template )
                self.output_template_nodes( template.node_tree )
        end
end
output_template_nodes( tree, indent=0 )

Output the given ‘tree` of nodes at the specified `indent` level.

# File lib/inversion/cli/tree.rb, line 39
def output_template_nodes( tree, indent=0 )
        indenttxt = ' ' * indent
        tree.each do |node|
                self.prompt.say( indenttxt + node.as_comment_body )
                self.output_template_nodes( node.subnodes, indent+4 ) if node.is_container?
        end
end