Inversion::CLI::

ApiCommand module

Api command

Public Instance Methods

describe_publications( template )

Output a list of sections the template publishes.

# File lib/inversion/cli/api.rb, line 51
def describe_publications( template )
        ptags = template.node_tree.find_all {|node| node.is_a?(Inversion::Template::PublishTag) }
        return if ptags.empty?

        pubnames = ptags.map( &:key ).map( &:to_s ).uniq.sort
        self.output_subheader "%d Publication/s" % [ pubnames.length ]
        self.display_list( pubnames )
        self.output_blank_line
end
describe_subscriptions( template )

Output a list of sections the template subscribes to.

# File lib/inversion/cli/api.rb, line 63
def describe_subscriptions( template )
        stags = template.node_tree.find_all {|node| node.is_a?(Inversion::Template::SubscribeTag) }
        return if stags.empty?

        subnames = stags.map( &:key ).map( &:to_s ).uniq.sort
        self.output_subheader "%d Subscription/s" % [ subnames.length ]
        self.display_list( subnames )
        self.output_blank_line
end
describe_template_api( template )

Output a description of the ‘template`’s attributes, subscriptions, etc.

# File lib/inversion/cli/api.rb, line 40
def describe_template_api( template )
        attrs = template.attributes.keys.map( &:to_s )
        return if attrs.empty?

        self.output_subheader "%d Attribute/s" % [ attrs.length ]
        self.display_list( attrs )
        self.output_blank_line
end