Andy Waite

Results 394 comments of Andy Waite

The example here is now working, but I'm seeing other failures for this cop - I'll open a separate issue. https://github.com/rubocop/rubocop/issues/12869

Displaying the latest version would require a network call, which may not be available, so showing a link to https://rubygems.org/gems/rubocop may be the best option.

Updated to use `current`.

@natematykiewicz thanks for the suggestion, I've pushed an update. It's a little awkward since it needs to be aware of all the potential params which could be passed. Also, CodeQL...

> Alternatively, I wonder if a redirect can be added directly in the router. > Would that help anything? I know there's route constraint classes you can make. It's possible,...

> I wonder if the user experience could improved by having `latest` act as a transparent alias of the latest version to save on needing to redirect? https://github.com/rubyapi/rubyapi/pull/1426

A slightly different approach is for `current` to redirect to the stable version, which is what `ruby-doc.org` does. e.g. https://ruby-doc.org/current/Module.html#method-i-ancestors redirects to https://ruby-doc.org/3.2.1/Module.html#method-i-ancestors. I'm unsure which I prefer.

Basically, yeah. There might some cases where a class/module is removed/renamed in a newer version of Ruby, so the redirect could be invalid, but I imagine that would be rare.