class Bakelite::Container::Writer

Overview

Packs files into a standalone .bkl container or appends a Bakelite volume directly onto the end of an existing executable image.

Defined in:

bakelite/container/writer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(target_path : Path | String) #

Instance Method Detail

def add_volume(volume : Volume) : self #

Adds a volume to be written into the container.


def find_or_create_volume(name : Symbol | String, mount_point : String = "", priority : Int32 = 0, default_chunk_size : UInt32 = 65536_u32, default_compression : CompressionType = CompressionType::Deflate) : Volume #

Finds an existing volume by name or creates and mounts a new one.


def pack_directory(source_dir : Path | String, volume_name : Symbol | String = :root, mount_point : String = "", priority : Int32 = 0, chunk_size : UInt32 = 65536_u32, compression : CompressionType = CompressionType::Deflate, exclude : Array(String) = [] of String) : self #

Packs a directory into a named volume.


def pack_stream(io : IO, size : Int64, virtual_path : String, volume_name : Symbol | String = :root, mount_point : String = "", priority : Int32 = 0, chunk_size : UInt32 = 65536_u32, compression : CompressionType = CompressionType::Deflate) : self #

Streams and packs an arbitrary IO stream into a named volume.


def target_path : Path #

def volumes : Array(Volume) #

def write(append : Bool = true) : Int64 #

Executes the pack operation. Appends to target if it already exists, or creates it anew.