Sha256: cf101690002aaba6900978c1a0eb63aee8c15aafccbc42208edb0ff6c8a1d12a

Contents?: true

Size: 1 KB

Versions: 20

Compression:

Stored size: 1 KB

Contents

module IOStreams
  module SymmetricEncryption
    class Writer < IOStreams::Writer
      # Write to stream using Symmetric Encryption
      # By default the output stream is compressed.
      # If the input_stream is already compressed consider setting compress: false.
      def self.stream(input_stream, compress: true, **args, &block)
        Utils.load_soft_dependency("symmetric-encryption", ".enc streaming") unless defined?(SymmetricEncryption)

        ::SymmetricEncryption::Writer.open(input_stream, compress: compress, **args, &block)
      end

      # Write to stream using Symmetric Encryption
      # By default the output stream is compressed unless the file_name extension indicates the file is already compressed.
      def self.file(file_name, compress: nil, **args, &block)
        Utils.load_soft_dependency("symmetric-encryption", ".enc streaming") unless defined?(SymmetricEncryption)

        ::SymmetricEncryption::Writer.open(file_name, compress: compress, **args, &block)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
iostreams-1.10.3 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.10.2 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.10.1 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.10.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.9.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.8.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.7.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.6.2 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.6.1 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.6.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.5.1 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.5.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.4.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.3.3 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.3.2 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.3.1 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.3.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.2.1 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.2.0 lib/io_streams/symmetric_encryption/writer.rb
iostreams-1.1.1 lib/io_streams/symmetric_encryption/writer.rb