Skip to content

Commit

Permalink
Merge pull request #431 from taichi-ishitani/fix_frozen_error
Browse files Browse the repository at this point in the history
Fix frozen error caused by frozen string literal
  • Loading branch information
jdleesmiller committed Feb 9, 2020
2 parents ecd641e + 976dbd3 commit 393cd97
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -5,6 +5,7 @@ rvm:
- 2.4
- 2.5
- 2.6
- 2.7
- ruby-head
matrix:
fast_finish: true
Expand Down
4 changes: 2 additions & 2 deletions lib/zip/crypto/decrypted_io.rb
Expand Up @@ -7,7 +7,7 @@ def initialize(io, decrypter)
@decrypter = decrypter
end

def read(length = nil, outbuf = '')
def read(length = nil, outbuf = +'')
return ((length.nil? || length.zero?) ? "" : nil) if eof

while length.nil? || (buffer.bytesize < length)
Expand All @@ -25,7 +25,7 @@ def eof
end

def buffer
@buffer ||= ''.dup
@buffer ||= +''
end

def input_finished?
Expand Down
2 changes: 1 addition & 1 deletion lib/zip/entry.rb
Expand Up @@ -615,7 +615,7 @@ def create_file(dest_path, _continue_on_exists_proc = proc { Zip.continue_on_exi
get_input_stream do |is|
bytes_written = 0
warned = false
buf = ''.dup
buf = +''
while (buf = is.sysread(::Zip::Decompressor::CHUNK_SIZE, buf))
os << buf
bytes_written += buf.bytesize
Expand Down
2 changes: 1 addition & 1 deletion lib/zip/extra_field.rb
Expand Up @@ -26,7 +26,7 @@ def extra_field_type_unknown(binstr, len, i)
end

def create_unknown_item
s = ''.dup
s = +''
class << s
alias_method :to_c_dir_bin, :to_s
alias_method :to_local_bin, :to_s
Expand Down
2 changes: 1 addition & 1 deletion lib/zip/inflater.rb
Expand Up @@ -3,7 +3,7 @@ class Inflater < Decompressor #:nodoc:all
def initialize(*args)
super

@buffer = ''.dup
@buffer = +''
@zlib_inflater = ::Zlib::Inflate.new(-Zlib::MAX_WBITS)
end

Expand Down

0 comments on commit 393cd97

Please sign in to comment.