8000 Merge pull request #431 from taichi-ishitani/fix_frozen_error · rubyzip/rubyzip@393cd97 · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit 393cd97

Browse files
authored
Merge pull request #431 from taichi-ishitani/fix_frozen_error
Fix frozen error caused by frozen string literal
2 parents ecd641e + 976dbd3 commit 393cd97

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ rvm:
55
- 2.4
66
- 2.5
77
- 2.6
8+
- 2.7
89
- ruby-head
910
matrix:
1011
fast_finish: true

lib/zip/crypto/decrypted_io.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize(io, decrypter)
77
@decrypter = decrypter
88
end
99

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

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

2727
def buffer
28-
@buffer ||= ''.dup
28+
@buffer ||= +''
2929
end
3030

3131
def input_finished?

lib/zip/entry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def create_file(dest_path, _continue_on_exists_proc = proc { Zip.continue_on_exi
615615
get_input_stream do |is|
616616
bytes_written = 0
617617
warned = false
618-
buf = ''.dup
618+
buf = +''
619619
while (buf = is.sysread(::Zip::Decompressor::CHUNK_SIZE, buf))
620620
os << buf
621621
bytes_written += buf.bytesize

lib/zip/extra_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def extra_field_type_unknown(binstr, len, i)
2626
end
2727

2828
def create_unknown_item
29-
s = ''.dup
29+
s = +''
3030
class << s
3131
alias_method :to_c_dir_bin, :to_s
3232
alias_method :to_local_bin, :to_s

lib/zip/inflater.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Inflater < Decompressor #:nodoc:all
33
def initialize(*args)
44
super
55

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

0 commit comments

Comments
 (0)
0