Class: ImagesGallery::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/images_gallery/generator.rb

Instance Method Summary collapse

Instance Method Details

#run(source, target) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/images_gallery/generator.rb', line 15

def run(source, target)

  raise SourceFileNotFoundError unless File.file? source
  raise TargetDirectoryNotFoundError unless File.directory? target

  @source = Models::Source.new(source)
  @target = target

  @source.parse
  files = render_views(@source.images)
  generate(target, files)
end