Sha256: c14d865f28a409b93670d92b823e1938d4cc1b900b7d1aa472a56ba1a329e5ff

Contents?: true

Size: 735 Bytes

Versions: 80

Compression:

Stored size: 735 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 and 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
    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

80 entries across 77 versions & 20 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/lib/zip/extra_field/unix.rb