Merge pull request #1817 from andyholmes/andyholmes/fix-fileexists-warning

fix: replace calls to `File.exists?` with `File.exist?`
pull/1824/head
Simon Legner 2 years ago committed by GitHub
commit b2cdeb8c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,7 +22,7 @@ module Docs
private
def assert_source_directory_exists
unless Dir.exists?(source_directory)
unless Dir.exist?(source_directory)
raise SetupError, "The #{self.class.name} scraper requires the original documentation files to be stored in the \"#{source_directory}\" directory."
end
end

@ -30,7 +30,7 @@ module Docs
end
def file_exist?(path)
File.exists?(path)
File.exist?(path)
end
def file_mtime(path)
@ -46,7 +46,7 @@ module Docs
next if file == path
Find.prune if File.basename(file)[0] == '.'
yield file
Find.prune unless File.exists?(file)
Find.prune unless File.exist?(file)
end
end
end

@ -175,12 +175,12 @@ class DocsCLI < Thor
# Verify files are present
docs.each do |doc|
unless Dir.exists?(File.join(Docs.store_path, doc.path))
unless Dir.exist?(File.join(Docs.store_path, doc.path))
puts "ERROR: directory #{File.join(Docs.store_path, doc.path)} not found."
return
end
unless File.exists?(File.join(Docs.store_path, "#{doc.path}.tar.gz"))
unless File.exist?(File.join(Docs.store_path, "#{doc.path}.tar.gz"))
puts "ERROR: package for '#{doc.slug}' documentation not found. Run 'thor docs:package #{doc.slug}' to create it."
return
end

Loading…
Cancel
Save