Class: Philiprehberger::Tar::ProgressWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/philiprehberger/tar.rb

Overview

A wrapper around Writer that adds progress callbacks without filtering.

Instance Method Summary collapse

Constructor Details

#initialize(writer, on_progress:) ⇒ ProgressWriter

Returns a new instance of ProgressWriter.



279
280
281
282
# File 'lib/philiprehberger/tar.rb', line 279

def initialize(writer, on_progress:)
  @writer = writer
  @on_progress = on_progress
end

Instance Method Details

#add_file(path, name: nil, total: nil) ⇒ Object



284
285
286
# File 'lib/philiprehberger/tar.rb', line 284

def add_file(path, name: nil, total: nil)
  @writer.add_file(path, name: name, on_progress: @on_progress, total: total)
end

#add_string(name, content, mode: 0o644, total: nil) ⇒ Object



288
289
290
# File 'lib/philiprehberger/tar.rb', line 288

def add_string(name, content, mode: 0o644, total: nil)
  @writer.add_string(name, content, mode: mode, on_progress: @on_progress, total: total)
end


292
293
294
# File 'lib/philiprehberger/tar.rb', line 292

def add_symlink(name, target:, total: nil)
  @writer.add_symlink(name, target: target, on_progress: @on_progress, total: total)
end