mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-21 11:18:06 +00:00
delete temporary files after use
This commit is contained in:
@@ -33,9 +33,9 @@ class ZipGenerator < StringEncoder
|
||||
zip_file.get_output_stream(self.file_name) { |os|
|
||||
os.write data
|
||||
}
|
||||
file_contents = File.binread(zip_file_path)
|
||||
FileUtils.rm(zip_file_path)
|
||||
end
|
||||
file_contents = File.binread(zip_file_path)
|
||||
FileUtils.rm(zip_file_path)
|
||||
end
|
||||
self.outputs << Base64.strict_encode64(file_contents)
|
||||
end
|
||||
@@ -65,4 +65,4 @@ class ZipGenerator < StringEncoder
|
||||
end
|
||||
end
|
||||
|
||||
ZipGenerator.new.run
|
||||
ZipGenerator.new.run
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/ruby
|
||||
require 'base64'
|
||||
require 'rmagick'
|
||||
require 'fileutils'
|
||||
require_relative '../../../../../lib/objects/local_string_encoder.rb'
|
||||
class ImageGenerator < StringEncoder
|
||||
attr_accessor :selected_image_path
|
||||
@@ -23,6 +24,7 @@ class ImageGenerator < StringEncoder
|
||||
image.write(tmp_file_path)
|
||||
|
||||
self.outputs << Base64.strict_encode64(File.binread(tmp_file_path))
|
||||
FileUtils.rm(tmp_file_path)
|
||||
end
|
||||
|
||||
def encoding_print_string
|
||||
@@ -30,4 +32,4 @@ class ImageGenerator < StringEncoder
|
||||
end
|
||||
end
|
||||
|
||||
ImageGenerator.new.run
|
||||
ImageGenerator.new.run
|
||||
|
||||
Reference in New Issue
Block a user