diff options
author | Martin Emde <[email protected]> | 2023-12-05 13:29:37 -0800 |
---|---|---|
committer | git <[email protected]> | 2023-12-06 02:45:37 +0000 |
commit | d9a1bb4b097899c21c9a11b042072224c4ff252b () | |
tree | 7bb32884b26c0cf2b63f8db83180dabbf2ad2e37 /lib | |
parent | b8b319dd1a48b695df8982eacf8b1ee0004c7a8b (diff) |
[rubygems/rubygems] Use String#unpack1 available since ruby 3.0
https://.com/rubygems/rubygems/commit/46258d6cb4
-rw-r--r-- | lib/bundler/checksum.rb | 3 | ||||
-rw-r--r-- | lib/bundler/digest.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/package/old.rb | 2 |
3 files changed, 3 insertions, 4 deletions
@@ -43,8 +43,7 @@ module Bundler return digest if digest.match?(/\A[0-9a-f]{64}\z/i) if digest.match?(%r{\A[-0-9a-z_+/]{43}={0,2}\z}i) digest = digest.tr("-_", "+/") # fix urlsafe base64 - # transform to hex. Use unpack1 when we drop older rubies - return digest.unpack("m0").first.unpack("H*").first end raise ArgumentError, "#{digest.inspect} is not a valid SHA256 hex or base64 digest" end @@ -50,7 +50,7 @@ module Bundler words.map!.with_index {|word, index| SHA1_MASK & (word + mutated[index]) } end - words.pack("N*").unpack("H*").first end private @@ -70,7 +70,7 @@ class Gem::Package::Old < Gem::Package file_data << line end - file_data = file_data.strip.unpack("m")[0] file_data = Zlib::Inflate.inflate file_data raise Gem::Package::FormatError, "#{full_name} in #{@gem} is corrupt" if |