ruby check if path is a directory
# Step 1: Require the 'fileutils' library for file and directory manipulation
require 'fileutils'
# Step 2: Define the path you want to check
path_to_check = '/path/to/your/directory'
# Step 3: Use the 'directory?' method from the 'File' class to check if the path is a directory
if File.directory?(path_to_check)
puts "The path is a directory."
else
puts "The path is not a directory."
end