End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Package::TarHeader.oct_or_256based
oct_or_256based(str)
lib/rubygems/package/tar_header.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/package/tar_header.rb, line 132
def self.oct_or_256based(str)
# \x80 flags a positive 256-based number
# \ff flags a negative 256-based number
# In case we have a match, parse it as a signed binary value
# in big-endian order, except that the high-order bit is ignored.
return str.unpack('N2').last if str =~ /\A[\x80\xff]/n
strict_oct(str)
end
No documentation available