rubycas / rubycas-client

Ruby client for Yale's Central Authentication Service protocol -- an open source enterprise single sign on system for web applications.
http://code.google.com/p/rubycas-client/
Other
332 stars 217 forks source link

File.exists? removed in Ruby 3.2 #97

Open SeanLF opened 1 year ago

SeanLF commented 1 year ago

After upgrading to Ruby 3.2, we had the following error pop up in Sentry:

NoMethodError: undefined method `exists?' for File:Class (NoMethodError)

          File.delete(ssl_filename) if File.exists?(ssl_filename)
                                           ^^^^^^^^
Did you mean?  exist?
  from rubycas-client (2.3.9) lib/casclient/tickets/storage.rb:129:in `cleanup_service_session_lookup'

According to Ruby 3.2's changelogs, File.exists has been removed:

Removed methods The following deprecated methods are removed.

[...] File.exists? [Feature #17391]


There are two references to File.exists? in the codebase, which need to be updated to File.exist?

https://github.com/rubycas/rubycas-client/blob/7b67c8f1b5515ee4e28479d640d2da0a5aadfbe0/lib/casclient/tickets/storage.rb#L116-L129