From 684ef9299a5c1bd27d10ce8a21880b3388e96805 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Fri, 1 Aug 2025 11:35:10 -0400 Subject: [PATCH] feat: replace Base64 usage with `String#pack` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The change here replaces the singular use of `Base64.strict_encode64` with that method’s body, `["…"].pack("m0")`, pulled straight from the Base64 gem’s source (linked below). See-also: https://github.com/ruby/base64/blob/v0.3.0/lib/base64.rb#L282-L284 --- .toys/release.rb | 3 +-- Gemfile | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.toys/release.rb b/.toys/release.rb index 6f80b4dd..d32c98d1 100644 --- a/.toys/release.rb +++ b/.toys/release.rb @@ -40,13 +40,12 @@ def build_docs end def pull_gh_pages - require "base64" Dir.chdir gh_pages_dir do exec ["git", "init"] exec ["git", "config", "--local", "user.name", "Google APIs"] exec ["git", "config", "--local", "user.email", "googleapis-packages@google.com"] if github_token && !github_token.empty? && github_remote.start_with?("https://") - encoded_token = Base64.strict_encode64("x-access-token:#{github_token}") + encoded_token = ["x-access-token:#{github_token}"].pack("m0") log_cmd = '["git", "config", "--local", "http.https://github.com/.extraheader", "****"]' exec ["git", "config", "--local", "http.https://github.com/.extraheader", "Authorization: Basic #{encoded_token}"], diff --git a/Gemfile b/Gemfile index c495c220..e7e740f8 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,6 @@ source "https://rubygems.org" gemspec -gem "base64" gem "google-style", "~> 1.31.0" gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.2"