Sha256: 02900d40d78fd4f26810f6d6b3a03e9c9978437f366597f03dddf326d17519c9
Contents?: true
Size: 934 Bytes
Versions: 6
Compression:
Stored size: 934 Bytes
Contents
module IOStreams module SymmetricEncryption class Writer # Write to file/stream using Symmetric Encryption def self.open(file_name_or_io, compress: nil, **args, &block) begin require 'symmetric-encryption' unless defined?(SymmetricEncryption) rescue LoadError => e raise(LoadError, "Please install the 'symmetric-encryption' gem for .enc streaming support. #{e.message}") end if IOStreams.writer_stream?(file_name_or_io) compress = true if compress.nil? ::SymmetricEncryption::Writer.open(file_name_or_io, compress: compress, **args, &block) else compress = !IOStreams.compressed?(file_name_or_io) if compress.nil? IOStreams::File::Writer.open(file_name_or_io) do |file| ::SymmetricEncryption::Writer.open(file, compress: compress, **args, &block) end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems