aarongustafson / jekyll-webmention_io

A Jekyll Plugin for rendering Webmentions via Webmention.io
https://aarongustafson.github.io/jekyll-webmention_io/
MIT License
139 stars 27 forks source link

Ruby 3.2 support #171

Closed danielpietzsch closed 1 year ago

danielpietzsch commented 1 year ago

While upgrading my Jekyll-build sites to Ruby 3.2, I noticed this gem is not compatible. Here’s more info, which I wrote in the commit message:

Replacing string_inflection gem with activesupport

string_inflection was incompatible with Ruby 3.2: .rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/string_inflection-0.1.2/lib/string_inflection.rb:11:in 'include': Refinement#include has been removed (TypeError)

instead of using string_inflection's to_singular method, now using ActiveSupport::Inflector.singularize

Had to upgrade rake from v12 to v13 due to general dependency conflicts.

I decided to not try and update the long-unmaintained 0.x-version string_inflection gem and instead go with the much more stable and maintained ActiveSupport.

However, including this much new code (also) seems overkill for just being able to use its singularize method. If I’m not mistaken, “only” the webmention types need to be singularized. And when looking at what seems to be the type-list, one could also simply get away with removing any trailing ”s”-es, and thereby get rid of any inflection-dependency altogether. Or not!? Anyhow, in this PR, I kept using string inflection. But I’d be happy to alternatively try and suggest a solution without inflection library.

fancypantalons commented 1 year ago

Looks good to me, thank you for the contribution!

fancypantalons commented 1 year ago

By the way, I'm honestly a bit indifferent about pulling in the additional dependency. A typical Jekyll site already has a mountain of dependencies and this one additional one (granted, just for this one method) doesn't strike me as a big deal. But if you feel motivated to pull together an alternative, lighter weight approach, I'd be happy to take a look at it!

danielpietzsch commented 1 year ago

Yep, fair enough! I’m also ok, with ActiveSupport being in the mix.

Thanks for the merge!