Class: IOStreams::Bzip2::Writer
- Defined in:
- lib/io_streams/bzip2/writer.rb
Instance Attribute Summary
Attributes inherited from Writer
Class Method Summary collapse
-
.stream(input_stream, original_file_name: nil, **_args) ⇒ Object
Write to a stream, compressing with Bzip2.
Methods inherited from Writer
Constructor Details
This class inherits a constructor from IOStreams::Writer
Class Method Details
.stream(input_stream, original_file_name: nil, **_args) ⇒ Object
Write to a stream, compressing with Bzip2
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/io_streams/bzip2/writer.rb', line 5 def self.stream(input_stream, original_file_name: nil, **_args) Utils.load_soft_dependency('rbzip2', 'Bzip2') unless defined?(RBzip2) begin io = RBzip2.default_adapter::Compressor.new(input_stream) yield io ensure io&.close end end |