Module: Templater::Manifold

### Home Classes Methods

### In Files

- lib/templater/manifold.rb

### Methods

- #add
- #add_private
- #add_public
- #desc
- #generator
- #generators
- #private_generators
- #public_generators
- #remove
- #run_cli

### Files

- History.txt
- Manifest.txt

### Class/Module Index

Quicksearch

- Templater
- Templater::ActionDescription
- Templater::Actions
- Templater::Actions::Action
- Templater::Actions::Directory
- Templater::Actions::EmptyDirectory
- Templater::Actions::File
- Templater::Actions::Template
- Templater::ArgumentDescription
- Templater::CLI
- Templater::CLI::Generator
- Templater::CLI::Manifold
- Templater::Description
- Templater::Discovery
- Templater::Generator
- Templater::InvocationDescription
- Templater::Manifold
- Templater::Spec
- Templater::Spec::Helpers
- Templater::Spec::Helpers::CreateMatcher
- Templater::Spec::Helpers::InvokeMatcher
- Kernel
- String

No matching classes.

# Templater::Manifold

### Public Instance Methods

add(name, generator) click to toggle source
Alias for: add_public
add_private(name, generator) click to toggle source

Add a generator for internal use to this manifold.

### Parameters

name<Symbol> | The name given to this generator in the manifold
generator<Templater::Generator> | The generator class

    # File lib/templater/manifold.rb, line 47
    def add_private(name, generator)
      private_generators[name.to_sym] = generator
      generator.manifold = self
    end

add_public(name, generator) click to toggle source

Add a generator to this manifold

### Parameters

name<Symbol> | The name given to this generator in the manifold
generator<Templater::Generator> | The generator class

    # File lib/templater/manifold.rb, line 35
    def add_public(name, generator)
      public_generators[name.to_sym] = generator
      generator.manifold = self
    end

Also aliased as: add
desc(text = nil) click to toggle source

If the argument is omitted, simply returns the description for this manifold, otherwise sets the description to the passed string.

### Parameters

text<String> | A description

### Returns

String | The description for this manifold

    # File lib/templater/manifold.rb, line 91
    def desc(text = nil)
      @text = text if text
      return @text.realign_indentation
    end

generator(name) click to toggle source

Finds the class of a generator, given its name in the manifold.

### Parameters

name<Symbol> | The name of the generator to find

### Returns

Templater::Generator | The found generator class

    # File lib/templater/manifold.rb, line 68
    def generator(name)
      generators[name.to_sym]
    end

generators() click to toggle source

Lists all generators in this manifold

### Returns

Array | A list of generators

    # File lib/templater/manifold.rb, line 9
    def generators
      private_generators.merge(public_generators)
    end

private_generators() click to toggle source

Lists all private generators, these are generators that are meant to be used only internally and should not be invoked directly (although the interface may choose to do so)

### Returns

Array | A list of generators

    # File lib/templater/manifold.rb, line 26
    def private_generators
      @private_generators ||= {}
    end

public_generators() click to toggle source

Lists all public generators, these are generators that are meant to be invoked directly by the user.

### Returns

Array | A list of generators

    # File lib/templater/manifold.rb, line 17
    def public_generators
      @public_generators ||= {}
    end

remove(name) click to toggle source

Remove the generator with the given name from the manifold

### Parameters

name<Symbol> | The name of the generator to be removed.

    # File lib/templater/manifold.rb, line 56
    def remove(name)
      public_generators.delete(name.to_sym)
      private_generators.delete(name.to_sym)
    end

run_cli(destination_root, name, version, args) click to toggle source

A Shortcut method for invoking the command line interface provided with Templater.

### Parameters

destination_root<String> | Where the generated files should be put, this would usually be Dir.pwd
name<String> | The name of the executable running this generator (such as 'merb-gen')
version<String> | The version number of the executable.
args> | An array of arguments to pass into the generator. This would usually be ARGV

    # File lib/templater/manifold.rb, line 79
    def run_cli(destination_root, name, version, args)
      Templater::CLI::Manifold.run(destination_root, self, name, version, args)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.