halostatue / minitar

Minimal pure-ruby support for POSIX tar(1) archives.
Other
38 stars 27 forks source link

Fix data size #32

Closed dearblue closed 5 years ago

dearblue commented 6 years ago

Sorry for collect two fixes to one pull request, because the conflict.

One is fix for should be use String#bytesize instead of String#size.

When packing the file included multibyte character, tar file is broken.

Another is fix for to be omissible size parameter with Minitar::Writer#add_file_simple.

Thanks.

AppVeyorBot commented 6 years ago

:white_check_mark: Build minitar 68 completed (commit https://github.com/halostatue/minitar/commit/e3a30bb9cd by @dearblue)

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 80.793% when pulling 7bdfb0d30ae5ca0df7f5793e87dfac40ca896a0a on dearblue:fix-data-size into 3acdc06d182cbd2205ec1acd1619f3d011cf36ca on halostatue:master.

dearblue commented 6 years ago

Is "not compatible" means missing #bytesize method? In that case, is use of monkey patch acceptable?

example:

unless String.method_defined?(:bytesize)
  class String
    alias bytesize size
  end
end

I am going to include this code.

dearblue commented 5 years ago

I'm sorry, I did not confirm "thumbs up" attached to my comment.

Thank you very much for your support. It's a great achievement!