Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ruby 3.2, DEPRECATED File.exists? #514

Open
sandraa-nestor opened this issue Nov 6, 2023 · 2 comments
Open

Support ruby 3.2, DEPRECATED File.exists? #514

sandraa-nestor opened this issue Nov 6, 2023 · 2 comments

Comments

@sandraa-nestor
Copy link

When I try to generate api docs on ruby 3.2.0 I get an error:

../lib/rspec_api_documentation/writers/writer.rb:17:in 'clear_docs': undefined method 'exists?' for File:Class (NoMethodError)

File.exists? was deprecated in ruby 2.1.0 and has been removed in the ruby 3.2.0

@nickmerwin
Copy link

As a workaround, you can add a monkey-patch like:

class File
  class << self
    alias_method :exists?, :exist?
  end
end

@pjscopeland
Copy link

Rubocop removes the line entirely as File.rm_rf is supposed to be idempotent and not care if the file doesn't exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants