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.



250
251
252
253
# File 'lib/philiprehberger/tar.rb', line 250

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

Instance Method Details

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



255
256
257
# File 'lib/philiprehberger/tar.rb', line 255

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



259
260
261
# File 'lib/philiprehberger/tar.rb', line 259

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


263
264
265
# File 'lib/philiprehberger/tar.rb', line 263

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