Class: Uttk::Generators::Generator::DirSource

Inherits:
Rails::Generator::Source
  • Object
show all
Defined in:
lib/uttk/generators/generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(label, *dirs) ⇒ DirSource

Returns a new instance of DirSource.



50
51
52
53
54
55
56
57
58
# File 'lib/uttk/generators/generator.rb', line 50

def initialize ( label, *dirs )
  super label
  @specs = []
  dirs.flatten.each do |dir|
    PathList[dir/'(*)_generator.rb'].each do |file, name|
      @specs << Rails::Generator::Spec.new(name, file.dirname, label)
    end
  end
end

Instance Method Details

#each(&block) ⇒ Object

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



62
63
64
# File 'lib/uttk/generators/generator.rb', line 62

def each ( &block )
  @specs.each(&block)
end