From cbb341a5b1867793c811f707a3d0e488b780a554 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Tue, 9 May 2023 23:54:56 -0600 Subject: alias File.exists? to File.exist? when loading RGhost optimizer to patch incompatibility when using Ruby 3.2 --- CHANGELOG.adoc | 1 + lib/asciidoctor/pdf/optimizer/rghost.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index e3427a95..4cda737d 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -50,6 +50,7 @@ Bug Fixes:: * don't crash if page background image value is empty (interpret as "none") * prevent special character substitution from interfering with callouts in plain verbatim block (#2390) * remove deprecated, undocumented `svg-font-family` theme key (the correct key is `svg-fallback-font-family`) +* alias `File.exists?` to `File.exist?` when loading RGhost optimizer to patch incompatibility when using Ruby 3.2 == 2.3.7 (2023-04-16) - @mojavelinux diff --git a/lib/asciidoctor/pdf/optimizer/rghost.rb b/lib/asciidoctor/pdf/optimizer/rghost.rb index 0bb011ad..880cf940 100644 --- a/lib/asciidoctor/pdf/optimizer/rghost.rb +++ b/lib/asciidoctor/pdf/optimizer/rghost.rb @@ -7,6 +7,9 @@ require 'rghost/gs_alone' require 'tmpdir' autoload :Open3, 'open3' +# rghost still uses File.exists? +File.singleton_class.alias_method :exists?, :exist? unless File.respond_to? :exists? + RGhost::GSAlone.prepend (Module.new do def initialize params, debug (@params = params.drop 0).push(*(@params.pop.split File::PATH_SEPARATOR)) -- cgit v1.2.3