Class Rails::Generator::Source
In: vendor/rails/railties/lib/rails_generator/lookup.rb
Parent: Object

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.

Methods

each   names   new  

Included Modules

Enumerable

Attributes

label  [R] 

Public Class methods

[Source]

     # File vendor/rails/railties/lib/rails_generator/lookup.rb, line 160
160:       def initialize(label)
161:         @label = label
162:       end

Public Instance methods

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

[Source]

     # File vendor/rails/railties/lib/rails_generator/lookup.rb, line 166
166:       def each
167:         raise NotImplementedError
168:       end

Return a convenient sorted list of all generator names.

[Source]

     # File vendor/rails/railties/lib/rails_generator/lookup.rb, line 171
171:       def names
172:         map { |spec| spec.name }.sort
173:       end

[Validate]