Class: RubiGen::Source

### Home Classes Methods

### In Files

- lib/rubigen/lookup.rb

### Parent

Object

### Methods

- ::new
- #each
- #names

### Included Modules

- Enumerable

### 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::Source

Sources enumerate (yield from each) generator specs which describe where to find and how to create generators. Enumerable is mixed in so, for example, source.collect will retrieve every generator. Sources may be assigned a label to distinguish them.

### Attributes

label[R]

### Public Class Methods

new(label) click to toggle source

    # File lib/rubigen/lookup.rb, line 189
    def initialize(label)
      @label = label
    end

### Public Instance Methods

each() click to toggle source

The each method must be implemented in subclasses. The base implementation raises an error.

    # File lib/rubigen/lookup.rb, line 195
    def each
      raise NotImplementedError
    end

names(filter = nil) click to toggle source

Return a convenient sorted list of all generator names.

    # File lib/rubigen/lookup.rb, line 200
    def names(filter = nil)
      inject([]) do |mem, spec|
        case filter
        when :visible
          mem << spec.name if spec.visible?
        end
        mem
      end.sort
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.