Closed craigscott-crascit closed 5 months ago
The correct fix is to remove the use of base64 entirely and use the lower-level [bindata].pack 'm0'
call instead (which does exactly the same thing). Ruby introduced a unnecessary incompatibility in a minor release when they removed base64 from stdlib. It cannot simply be fixed by adding the base64 dependency since that it creates a packaging conflict for Ruby < 3.3.
See https://github.com/asciidoctor/asciidoctor/pull/4562 for reference.
I ended up using https://github.com/subvisual/ruby-radix-encoding. The encoding for PlantUML is actually not RFC 4648 base64. The author used a different alphabet.
I was just reviewing the dependencies of that gem... I'm going to have to inline it most likely because it pulls in way too much other stuff. Don't want an activesupport
dependency...
pack('m0')
followed by a tr
to swizzle the alphabet did the trick
After updating to Ruby 3.3.0, I started seeing the following warning:
The end of that warning seems fairly self-explanatory. Looks like base64 needs to be added to the gemspec here.