Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asciidoctor-kroki ruby-0.9.1 (latest available) does not work with asciidoctor 2.0.22 #444

Closed
dduportal opened this issue Mar 12, 2024 · 12 comments · Fixed by #445
Closed

Comments

@dduportal
Copy link

Hi! As caught in asciidoctor/docker-asciidoctor#437, asciidoctor-kroki ruby-0.9.1 (latest available) does not work with asciidoctor 2.0.22.

@mojavelinux recommens to use String#pack but I'm not good enough in Ruby to understand what it means (searching https://ruby-doc.org/3.3.0/String.html does not show me tangible result) so I'm opening an issue whether a PR.

@mojavelinux
Copy link
Member

The equivalent code can be found here: https://github.com/ruby/base64/blob/master/lib/base64.rb#L328-L333

It would look something like this:

str = ([str].pack 'm0').tr '+/', '-_'

@mojavelinux
Copy link
Member

mojavelinux commented Mar 12, 2024

The extension shouldn't be relying on Asciidoctor to load a library from stdlib (and base64 is being removed from the stdlib in Ruby 3.4 anyway).

@ggrossetie
Copy link
Member

That's weird to remove such as useful and tiny lib from stdlib 🤔
I wonder why they thought it was a good idea.

@mojavelinux
Copy link
Member

I totally agree that it was a very unwise choice.

@jaskij
Copy link

jaskij commented Mar 13, 2024

In the meantime, is a workaround available?

@mojavelinux
Copy link
Member

You can also just add -r base64 when invoking the asciidoctor command.

@dduportal
Copy link
Author

Thanks @ggrossetie , I'll watch when the new release will be available to ensure the Docker image of asciidoctor picks it!

@dduportal
Copy link
Author

Hello @ggrossetie @mojavelinux could we release a new version of asciidoctor-kroki to ensure the fix is available (as it is blocking asciidoctor/docker-asciidoctor#437)?

As I'm requesting this, I do not mind to help if needed (and possible in term of permissions of course)

@ggrossetie
Copy link
Member

Sorry forgot to push the release, 0.10.0 should be available soon

@ggrossetie
Copy link
Member

@dduportal Could you please give it a try https://rubygems.org/gems/asciidoctor-kroki/versions/0.10.0 ?

@dduportal
Copy link
Author

@dduportal Could you please give it a try https://rubygems.org/gems/asciidoctor-kroki/versions/0.10.0 ?

Many thanks @ggrossetie !

@ggrossetie
Copy link
Member

Awesome 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants