Class: Philiprehberger::Tar::ProgressWriter
- Inherits:
-
Object
- Object
- Philiprehberger::Tar::ProgressWriter
- Defined in:
- lib/philiprehberger/tar.rb
Overview
A wrapper around Writer that adds progress callbacks without filtering.
Instance Method Summary collapse
- #add_file(path, name: nil, total: nil) ⇒ Object
- #add_string(name, content, mode: 0o644, total: nil) ⇒ Object
- #add_symlink(name, target:, total: nil) ⇒ Object
-
#initialize(writer, on_progress:) ⇒ ProgressWriter
constructor
A new instance of ProgressWriter.
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 |
#add_symlink(name, target:, total: nil) ⇒ Object
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 |