merit-gem / merit

Reputation engine for Rails apps
Other
1.52k stars 197 forks source link

Fix warning: add observer as runtime dependency #367

Open pbourdet opened 2 months ago

pbourdet commented 2 months ago

Hello,

Fix of the following warning : observer won't be part of the default gems with ruby 3.4

/usr/local/bundle/gems/zeitwerk-2.6.16/lib/zeitwerk/kernel.rb:34: warning: observer was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add observer to your Gemfile or gemspec. Also contact author of merit-4.0.3 to add observer into its gemspec.
tute commented 2 months ago

Thank you, but even with this addition the gem doesn't work with Ruby 3.4 (and tests error out). Please add an available ruby 3.4 version to .travis.yml's rvm section, exclusions as make sense to avoid unsupported Rails versions for that Ruby, and let's get it ready! 💪

pbourdet commented 2 months ago

Alright, I'll update my PR when I'll have some time.

Out of curiosity, which source did you use for compatibility matrix between Rails and Ruby version ? I found this one https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html and I see that Rails 5.2 is not compatible with Ruby 2.7, yet you only excluded Ruby 3.0 in the .travis.yml matrix

tute commented 2 months ago

I checked whether it errored out or failed any of merit's tests, disallowing only combinations that I couldn't work out.

tute commented 2 months ago

Travis CI was offline for this project for long @pbourdet, I just converted the project to GitHub Actions: https://github.com/merit-gem/merit/commit/08e65bd9a44de753100df23d62e1d24ec93f2ef8

See matrix of tests in the last run: https://github.com/merit-gem/merit/actions/runs/9822341907

You may add ruby 3.4, and rails 7.2 beta if you please. cc @fedesapuppo who was following this issue too.

pbourdet commented 2 months ago

Hello @tute,

Great, nice work!

Sorry I got busy and didn't have much time for this PR. I quickly added ruby 3.4 in the matrix just to see. The build did not start though 🤔. Do you have to start it manually ?

Edit : yes it looks like it's waiting for a maintainer approval 😄

tute commented 2 months ago

Right, just ran it. Left a comment ~I shouldn't have~ that may help you in https://github.com/merit-gem/merit/commit/08e65bd9a44de753100df23d62e1d24ec93f2ef8#diff-d09ea66f8227784ff4393d88a19836f321c915ae10031d16c93d67e6283ab55f (this belongs in Appraisal which I just configured in merit, see https://github.com/thoughtbot/appraisal).

pbourdet commented 1 month ago

Hello @tute,

I updated my PR, if you can try to re-run the build