Class: Rails::Generator::GemPathSource

Inherits:
AbstractGemSource show all
Defined in:
lib/rails_generator/lookup.rb

Overview

GemPathSource looks for generators within any RubyGem’s /rails_generators/<generator_name>_generator.rb file.

Instance Attribute Summary

Attributes inherited from Source

#label

Instance Method Summary collapse

Methods inherited from AbstractGemSource

#initialize

Methods inherited from Source

#initialize, #names

Constructor Details

This class inherits a constructor from Rails::Generator::AbstractGemSource

Instance Method Details

#eachObject

Yield each generator within rails_generator subdirectories.



225
226
227
228
229
# File 'lib/rails_generator/lookup.rb', line 225

def each
  generator_full_paths.each do |generator|
    yield Spec.new(File.basename(generator).sub(/_generator.rb$/, ''), File.dirname(generator), label)
  end
end