Class: Availability::AtomicWriter
- Inherits:
-
Object
- Object
- Availability::AtomicWriter
- Defined in:
- lib/availability/atomic_writer.rb
Overview
Writes generated assets through same-filesystem temporary files and renames.
Class Method Summary collapse
Class Method Details
.write_all(output_dir, files) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/availability/atomic_writer.rb', line 9 def self.write_all(output_dir, files) FileUtils.mkdir_p(output_dir) temporary = prepare_files(output_dir, files) publish_files(output_dir, files.keys, temporary) ensure cleanup(temporary) end |