History

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

Simon Legner committed 4 years ago

Commit b2cdeb82 parents 01d0319 961bbeb3 files · +5 −5Browse files

Unified · Split

3 files
  1. lib/docs/core/scrapers/file_scraper.rb +1 −1
  2. lib/docs/storage/file_store.rb +2 −2
  3. lib/tasks/docs.thor +2 −2
lib/docs/core/scrapers/file_scraper.rb+1−1
@@ -22,7 +22,7 @@ module Docs · 21 unmodified lines
2222 private
2323
2424 def assert_source_directory_exists
25− unless Dir.exists?(source_directory)
25+ unless Dir.exist?(source_directory)
2626 raise SetupError, "The #{self.class.name} scraper requires the original documentation files to be stored in the \"#{source_directory}\" directory."
2727 end
2828 end
lib/docs/storage/file_store.rb+2−2
@@ -30,7 +30,7 @@ module Docs · 29 unmodified lines
3030 end
3131
3232 def file_exist?(path)
33− File.exists?(path)
33+ File.exist?(path)
3434 end
3535
3636 def file_mtime(path)
@@ -46,7 +46,7 @@ module Docs · 9 unmodified lines
4646 next if file == path
4747 Find.prune if File.basename(file)[0] == '.'
4848 yield file
49− Find.prune unless File.exists?(file)
49+ Find.prune unless File.exist?(file)
5050 end
5151 end
5252 end
lib/tasks/docs.thor+2−2
@@ -175,12 +175,12 @@ class DocsCLI < Thor · 174 unmodified lines
175175
176176 # Verify files are present
177177 docs.each do |doc|
178− unless Dir.exists?(File.join(Docs.store_path, doc.path))
178+ unless Dir.exist?(File.join(Docs.store_path, doc.path))
179179 puts "ERROR: directory #{File.join(Docs.store_path, doc.path)} not found."
180180 return
181181 end
182182
183− unless File.exists?(File.join(Docs.store_path, "#{doc.path}.tar.gz"))
183+ unless File.exist?(File.join(Docs.store_path, "#{doc.path}.tar.gz"))
184184 puts "ERROR: package for '#{doc.slug}' documentation not found. Run 'thor docs:package #{doc.slug}' to create it."
185185 return
186186 end