govuk_publishing_components
govuk_publishing_components copied to clipboard
Views using features deprecated in Ruby 2.7+ (and likely breaking in Ruby 3)
When running tests for the smart answers app, which includes this gem, we see deprecation messages like:
/var/lib/jenkins/bundles/ruby/2.7.0/gems/govuk_publishing_components-28.5.0/app/views/govuk_publishing_components/components/_input.html.erb:101: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
These are 2.7 deprecations, and will become breaking changes in Ruby 3.0, and require changing (eg)
<% if button.info_text %>
<%= tag.span button.info_text, button.info_text_options %>
<% end %>
..to..
<% if button.info_text %>
<%= tag.span button.info_text, **button.info_text_options %>
<% end %>
(ie using a double splat to explicitly break the single argument into named arguments to the method)
This sort of call occurs quite frequently in the component views, so might need someone to build the gem against 2.7 and run through the tests with deprecation messages on.
I've just run into this @KludgeKML – thanks for recording the issue for visibility!
Related issue in govuk_app_config: https://github.com/alphagov/govuk_app_config/issues/222
This has already been addressed.