Sha256: 2c727bb4cf8ba29c73edfa771ce2e4acf89118f149feea058e829920c5c2ca79
Contents?: true
Size: 780 Bytes
Versions: 45
Compression:
Stored size: 780 Bytes
Contents
module Zip # Info-ZIP Extra for UNIX uid/gid class ExtraField::IUnix < ExtraField::Generic HEADER_ID = 'Ux' register_map def initialize(binstr = nil) @uid = 0 @gid = 0 binstr && merge(binstr) end attr_accessor :uid, :gid def merge(binstr) return if binstr.empty? size, content = initial_parse(binstr) # size: 0 for central directory. 4 for local header return if !size || size == 0 uid, gid = content.unpack('vv') @uid ||= uid @gid ||= gid # rubocop:disable Naming/MemoizedInstanceVariableName end def ==(other) @uid == other.uid && @gid == other.gid end def pack_for_local [@uid, @gid].pack('vv') end def pack_for_c_dir '' end end end
Version data entries
45 entries across 35 versions & 8 rubygems