varvet / pundit

Minimal authorization through OO design and pure Ruby classes
MIT License
8.22k stars 625 forks source link

use File.exist? instead of File.exists? #754

Closed johanandre closed 1 year ago

johanandre commented 1 year ago

File.exists? is deprecated in Ruby > 3.2. This causes an error when running the policy generator.

Obversity commented 1 year ago

Can confirm that it's an issue for me too in a new-ish project, would be great to get this merged so people can use Ruby 3.2.

(Looks like the failing build is just Jruby and some incompatible ruby/bundler versions, I don't know enough about it to propose a fix sorry!)

dgmstuart commented 1 year ago

@johanandre thanks for the PR. Looks like this is a breaking change for that version of JRuby - could you try updating the version of JRuby to 9.3?

I can't work out if JRuby 9.2 is still supported (maybe @olleolleolle knows?). If so then either we need a solution which supports both usages, or to make a major version change.

olleolleolle commented 1 year ago

@dgmstuart https://www.jruby.org/2022/06/27/jruby-9-2-21-0.html shows the last 9.2 release of JRuby.

That series implements Ruby 2.5. That Ruby is EOL.

I think it's fair not to keep supporting Ruby 2.5.

I also don't think it needs a major to drop support for an EOL Ruby version.

Hope this helps!

Burgestrand commented 1 year ago

I relatively recently (4 days ago) merged https://github.com/varvet/pundit/pull/758 which changes the lowest JRuby version to 9.3 — if you rebase on main this might be good to go!

johanandre commented 1 year ago

@dgmstuart @olleolleolle I've updated the jruby version in the travis config to 9.3.10.0 which seems to be the oldest supported one. JRuby is kind of a mystery to me, so I hope that is correct!

marcoroth commented 1 year ago

Hey there, just wanted to check if there are any plans to release this fix in a patch release?

Using gem "pundit", github: "varvet/pundit" resolves this for now on Ruby 3.2.

Burgestrand commented 1 year ago

Hi @marcoroth this has now been released 😊

marcoroth commented 1 year ago

Hey @Burgestrand, thank you for the release and the heads up! 🙏🏼