Class: SvgThang::Mirrorer
- Inherits:
-
Object
- Object
- SvgThang::Mirrorer
- Defined in:
- lib/svgthang/mirrorer.rb
Instance Attribute Summary collapse
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
Instance Method Summary collapse
-
#initialize(output_dir:) ⇒ Mirrorer
constructor
A new instance of Mirrorer.
- #mirror(dir:, &each_file) ⇒ Object
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_dir ⇒ Object (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 |