From 1c2fc28bc2180883ef7146573a1fcd5320dce718 Mon Sep 17 00:00:00 2001 From: Arthur Klepchukov Date: Wed, 2 Oct 2024 12:33:20 -0400 Subject: [PATCH 1/2] fix: mime type string deprecation mime-types 3.6.0 warns "MIME::Type.MIME::Type.new when called with a String is deprecated." change introduced in and syntax borrowed from: https://github.com/mime-types/ruby-mime-types/commit/8512c1544e9b4a292284865c4d0c2b04e126fcc7 --- lib/mechanize/pluggable_parsers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mechanize/pluggable_parsers.rb b/lib/mechanize/pluggable_parsers.rb index 21a90b06..44af507a 100644 --- a/lib/mechanize/pluggable_parsers.rb +++ b/lib/mechanize/pluggable_parsers.rb @@ -104,7 +104,7 @@ def parser content_type return parser if parser - mime_type = MIME::Type.new content_type + mime_type = MIME::Type.new "content-type" => content_type parser = @parsers[mime_type.to_s] || @parsers[mime_type.simplified] || From 5b7485249bec79d8c63f0d387498ac9199cb6d1c Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Wed, 2 Oct 2024 14:10:28 -0400 Subject: [PATCH 2/2] dep: bump the min version of mime-types to one that supports modern ruby. --- mechanize.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mechanize.gemspec b/mechanize.gemspec index beca19e3..a0bdf345 100644 --- a/mechanize.gemspec +++ b/mechanize.gemspec @@ -56,7 +56,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency("addressable", "~> 2.8") spec.add_runtime_dependency("domain_name", ">= 0.5.20190701", "~> 0.5") spec.add_runtime_dependency("http-cookie", ">= 1.0.3", "~> 1.0") - spec.add_runtime_dependency("mime-types", "~> 3.0") + spec.add_runtime_dependency("mime-types", "~> 3.3") spec.add_runtime_dependency("net-http-digest_auth", ">= 1.4.1", "~> 1.4") # careful! some folks are relying on older versions of net-http-persistent