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
Included Modules
Attributes
| [R] | label |
Public Class methods
[ show source ]
# File railties/lib/rails_generator/lookup.rb, line 164
164: def initialize(label)
165: @label = label
166: end
Public Instance methods
The each method must be implemented in subclasses. The base implementation raises an error.
[ show source ]
# File railties/lib/rails_generator/lookup.rb, line 170
170: def each
171: raise NotImplementedError
172: end
Return a convenient sorted list of all generator names.
[ show source ]
# File railties/lib/rails_generator/lookup.rb, line 175
175: def names
176: map { |spec| spec.name }.sort
177: end