Class: SvgThang::Mirrorer

Inherits:
Object
  • Object
show all
Defined in:
lib/svgthang/mirrorer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output_dir:) ⇒ Mirrorer

Returns a new instance of Mirrorer.



8
9
10
# File 'lib/svgthang/mirrorer.rb', line 8

def initialize(output_dir:)
  @output_dir = output_dir
end

Instance Attribute Details

#output_dirObject (readonly)

Returns the value of attribute output_dir.



6
7
8
# File 'lib/svgthang/mirrorer.rb', line 6

def output_dir
  @output_dir
end

Instance Method Details

#mirror(dir:, &each_file) ⇒ Object



12
13
14
15
# File 'lib/svgthang/mirrorer.rb', line 12

def mirror(dir:, &each_file)
  FileUtils.mkdir_p Pathname.new(output_dir).join(File.basename(dir))
  mirror_children(dir, File.basename(dir), &each_file)
end