class RubiGen::PathSource

PathSource looks for generators in a filesystem directory.

Attributes

path[R]

Public Class Methods

new(label, path) click to toggle source
Calls superclass method RubiGen::Source.new
# File lib/rubigen/lookup.rb, line 218
def initialize(label, path)
  super label
  @path = File.expand_path path
end

Public Instance Methods

==(source) click to toggle source
# File lib/rubigen/lookup.rb, line 232
def ==(source)
  self.class == source.class && path == source.path
end
each() { |spec(basename, dir, label)| ... } click to toggle source

Yield each eligible subdirectory.

# File lib/rubigen/lookup.rb, line 224
def each
  Dir["#{path}/[a-z]*"].each do |dir|
    if File.directory?(dir)
      yield Spec.new(File.basename(dir), dir, label)
    end
  end
end