Class: Tamplier::Iterator

Inherits:
Object
  • Object
show all
Defined in:
lib/tamplier/iterator.rb

Constant Summary collapse

TEMPLATES =
%w[yml.sample sample.yml yml.example example.yml]

Instance Method Summary collapse

Instance Method Details

#call(root) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/tamplier/iterator.rb', line 4

def call(root)
  TEMPLATES.each do |template|
    Pathname.glob(File.join(root, "*.#{template}")).each do |sample_file|
      yield(sample_file, sample_file.sub(template, 'yml'))
    end
  end
end