From cccea10d3b4e10eec9415e7c364a7469c451c069 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 8 Jan 2026 07:49:12 -0500 Subject: [PATCH] fix: replace deprecated CGI.parse with URI.decode_www_form for Ruby 4.0 compatibility Ruby 4.0 removed CGI.parse from the standard library. Use URI.decode_www_form instead, which is part of the core URI library and provides identical functionality. --- lib/yt/models/resumable_session.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/yt/models/resumable_session.rb b/lib/yt/models/resumable_session.rb index 86737853..ba189245 100644 --- a/lib/yt/models/resumable_session.rb +++ b/lib/yt/models/resumable_session.rb @@ -1,4 +1,3 @@ -require 'cgi' require 'yt/models/base' module Yt @@ -30,7 +29,7 @@ def upload_thumbnail(file) private def session_params - CGI::parse(@uri.query).tap{|hash| hash.each{|k,v| hash[k] = v.first}} + URI.decode_www_form(@uri.query || "").to_h end # @note: YouTube documentation states that a valid upload returns an HTTP