Module: RubiGen::Commands

### Home Classes Methods

### In Files

- lib/rubigen/commands.rb

### Namespace

- CLASS RubiGen::Commands::Base
- CLASS RubiGen::Commands::Create
- CLASS RubiGen::Commands::Destroy
- CLASS RubiGen::Commands::List
- CLASS RubiGen::Commands::RewindBase
- CLASS RubiGen::Commands::Update

### Methods

- ::included
- ::instance

### Files

- History.txt
- License.txt
- Manifest.txt
- Todo.txt
- README.txt
- index.txt
- version-raw.txt
- version.txt

### Class/Module Index

Quicksearch

- RubiGen
- RubiGen::AbstractGemSource
- RubiGen::Base
- RubiGen::Commands
- RubiGen::Commands::Base
- RubiGen::Commands::Create
- RubiGen::Commands::Destroy
- RubiGen::Commands::List
- RubiGen::Commands::RewindBase
- RubiGen::Commands::Update
- RubiGen::GemPathSource
- RubiGen::GeneratedAttribute
- RubiGen::GeneratorError
- RubiGen::GeneratorTestHelper
- RubiGen::Lookup
- RubiGen::Lookup::ClassMethods
- RubiGen::Manifest
- RubiGen::Options
- RubiGen::Options::ClassMethods
- RubiGen::PathFilteredSource
- RubiGen::PathSource
- RubiGen::Scripts
- RubiGen::Scripts::Base
- RubiGen::Scripts::Destroy
- RubiGen::Scripts::Generate
- RubiGen::Scripts::Update
- RubiGen::Source
- RubiGen::Spec
- RubiGen::UsageError
- Rubigen
- Rubigen::CLI
- Dir
- Object

No matching classes.

# RubiGen::Commands

### Public Class Methods

included(base) click to toggle source

Even more convenient access to commands. Include Commands in the generator Base class to get a nice command instance method which returns a delegate for the requested command.

    # File lib/rubigen/commands.rb, line 19
    def self.included(base)
      base.send(:define_method, :command) do |command|
        Commands.instance(command, self)
      end
    end

instance(command, generator) click to toggle source

Here's a convenient way to get a handle on generator commands. Command.instance('destroy', my_generator) instantiates a Destroy delegate of my_generator ready to do your dirty work.

    # File lib/rubigen/commands.rb, line 12
    def self.instance(command, generator)
      const_get(command.to_s.camelize).new(generator)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.