asciidoctor / asciidoctor-kroki

Asciidoctor.js extension to convert diagrams to images using Kroki!
https://kroki.io/
MIT License
146 stars 47 forks source link

Deprecating warning with Ruby with positional/keyword arguments #257

Closed ggrossetie closed 3 years ago

ggrossetie commented 3 years ago

This warning can be seen on GitLab CI:

DEPRECATION WARNING: /builds/gitlab-org-forks/gitlab/vendor/ruby/2.7.0/gems/asciidoctor-2.0.15/lib/asciidoctor/extensions.rb:1398: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/builds/gitlab-org-forks/gitlab/vendor/ruby/2.7.0/gems/asciidoctor-kroki-0.4.0/lib/asciidoctor/extensions/asciidoctor_kroki/extension.rb:22: warning: The called method `initialize' is defined here

https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

It's related to:

https://github.com/Mogztter/asciidoctor-kroki/blob/ba0a88c31b606e955c3d26e7cb093cff9e121b87/ruby/lib/asciidoctor/extensions/asciidoctor_kroki/extension.rb#L22

Dan Allen suggested that we move the logger fallback assignment into the initialize method because we are mixing hash argument (config) with keyword argument (logger).

ggrossetie commented 3 years ago

Downstream issue: https://gitlab.com/gitlab-org/gitlab/-/issues/328031

mttkay commented 3 years ago

@Mogztter Thank you for fixing this! This hasn't made it in any release yet has it? Would it be possible to cut a new release that includes this fix? We are looking to support Ruby 3 in GitLab and are currently blocked by this issue: https://gitlab.com/gitlab-org/gitlab/-/issues/328031 (among many other similar issues :upside_down_face:)

ggrossetie commented 3 years ago

@mttkay Sure, I just released version 0.5.0:

mttkay commented 3 years ago

Thank you! :bow: