rspec_api_documentation
rspec_api_documentation copied to clipboard
Support ruby 3.2, DEPRECATED File.exists?
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
As a workaround, you can add a monkey-patch like:
class File
class << self
alias_method :exists?, :exist?
end
end
Rubocop removes the line entirely as File.rm_rf
is supposed to be idempotent and not care if the file doesn't exist