Ruby

Ruby

Made by DeepSource

Use of deprecated class methods RB-LI1009

Bug risk
Major
Autofix

Some class methods, such as exists (for classes File and Dir) and iterator have been deprecated in favour of exist and block_given respectively.

Bad practice

File.exists?(some_path)
Dir.exists?(some_path)

if iterator?
  yield
end

Recommended

File.exist?(some_path)
Dir.exist?(some_path)

if block_given?
  yield
end