lib/image_processing/null.rb in wasmify-rails-0.1.0 vs lib/image_processing/null.rb in wasmify-rails-0.1.1
- old
+ new
@@ -12,9 +12,10 @@
def self.call(source:, loader:, operations:, saver:, destination: nil)
fail ArgumentError, "A string path is expected, got #{source.class}" unless source.is_a?(String)
fail ArgumentError, "File not found: #{source}" unless File.file?(source)
if destination
+ File.delete(destination) if File.identical?(source, destination)
FileUtils.cp(source, destination)
end
end
end
end