Add a generator for internal use to this manifold.
name | The name given to this generator in the manifold |
generator | The generator class |
# File lib/templater/manifold.rb, line 47 47: def add_private(name, generator) 48: private_generators[name.to_sym] = generator 49: generator.manifold = self 50: end
Add a generator to this manifold
name | The name given to this generator in the manifold |
generator | The generator class |
# File lib/templater/manifold.rb, line 35 35: def add_public(name, generator) 36: public_generators[name.to_sym] = generator 37: generator.manifold = self 38: end
If the argument is omitted, simply returns the description for this manifold, otherwise sets the description to the passed string.
text | A description |
String | The description for this manifold |
# File lib/templater/manifold.rb, line 91 91: def desc(text = nil) 92: @text = text if text 93: return @text.realign_indentation 94: end
Finds the class of a generator, given its name in the manifold.
name | The name of the generator to find |
Templater::Generator | The found generator class |
# File lib/templater/manifold.rb, line 68 68: def generator(name) 69: generators[name.to_sym] 70: end
Lists all generators in this manifold
Array[Templater::Generator] | A list of generators |
# File lib/templater/manifold.rb, line 9 9: def generators 10: private_generators.merge(public_generators) 11: end
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)
Array[Templater::Generator] | A list of generators |
# File lib/templater/manifold.rb, line 26 26: def private_generators 27: @private_generators ||= {} 28: end
Lists all public generators, these are generators that are meant to be invoked directly by the user.
Array[Templater::Generator] | A list of generators |
# File lib/templater/manifold.rb, line 17 17: def public_generators 18: @public_generators ||= {} 19: end
Remove the generator with the given name from the manifold
name | The name of the generator to be removed. |
# File lib/templater/manifold.rb, line 56 56: def remove(name) 57: public_generators.delete(name.to_sym) 58: private_generators.delete(name.to_sym) 59: end
A Shortcut method for invoking the command line interface provided with Templater.
destination_root | Where the generated files should be put, this would usually be Dir.pwd |
name | The name of the executable running this generator (such as ‘merb-gen’) |
version | 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 79: def run_cli(destination_root, name, version, args) 80: Templater::CLI::Manifold.run(destination_root, self, name, version, args) 81: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.