Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/xz.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def decompress_stream(io, memory_limit: LibLZMA::UINT64_MAX, flags: [:tell_unsup

LZMAError.raise_if_necessary(res)

res = ""
res = +""
res.encode!(Encoding::BINARY)
if block_given?
res = lzma_code(io, stream) do |chunk|
Expand Down Expand Up @@ -310,7 +310,7 @@ def compress_stream(io, level: 6, check: :crc64, extreme: false, &block)

LZMAError.raise_if_necessary(res)

res = ""
res = +""
res.encode!(Encoding::BINARY)
if block_given?
res = lzma_code(io, stream, &block)
Expand Down
2 changes: 1 addition & 1 deletion lib/xz/stream_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def read(length = nil, outbuf = String.new)
# The user's request is in decompressed bytes, so it doesn't matter
# how much is actually read from the compressed file.
if @delegate_io.eof?
data = ""
data = +""
action = XZ::LibLZMA::LZMA_FINISH
else
data = @delegate_io.read(XZ::CHUNK_SIZE)
Expand Down
2 changes: 1 addition & 1 deletion lib/xz/stream_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def write(*args)
# Like superclass' method, but also ensures liblzma flushes all
# compressed data to the delegate IO.
def finish
lzma_code("", XZ::LibLZMA::LZMA_FINISH) { |compressed| @delegate_io.write(compressed) }
lzma_code(+"", XZ::LibLZMA::LZMA_FINISH) { |compressed| @delegate_io.write(compressed) }
super
end

Expand Down
1 change: 1 addition & 0 deletions ruby-xz.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ GEMSPEC = Gem::Specification.new do |spec|
spec.platform = Gem::Platform::RUBY
spec.post_install_message = 'Version 1.0.0 of ruby-xz breaks the API. Read HISTORY.rdoc and adapt your code to the new API.'

spec.add_dependency 'fiddle', '~> 1.0.9'
spec.add_development_dependency 'minitar', '~> 0.6'
spec.add_development_dependency 'minitest', '~> 5.14'
spec.add_development_dependency 'rake', '~> 13.0'
Expand Down