Maintenance Ruby 3.3 gets fixes, but no new features. 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.3.0/lib/rubygems/package/tar_header.rb, line 136
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.unpack1("@4N") if /\A[\x80\xff]/n.match?(str)
strict_oct(str)
end
No documentation available