Sha256: 1ff99eb8aa36febeeb9dbfb36dcf00a57749a276a4dfe00f994341f5f9835b82
Contents?: true
Size: 565 Bytes
Versions: 13
Compression:
Stored size: 565 Bytes
Contents
require 'condenser/utils' # Writes an asset file to disk class Condenser::FileWriter attr_reader :mime_types def initialize(mime_types: nil) @mime_types = mime_types || '*/*' end def path(asset) asset.path end def exist?(asset) ::File.exist?(path(asset)) end def call(output_directory, asset) filename = File.join(output_directory, asset.path) FileUtils.mkdir_p(File.dirname(filename)) Condenser::Utils.atomic_write(filename) do |file| file.write(asset.source) end [asset.filename] end end
Version data entries
13 entries across 13 versions & 1 rubygems