Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Pathname#rmdir
() -> 0
rmdir → 0
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 2925
def rmdir() Dir.rmdir(@path) end
Deletes the directory at the path in self; returns 0:
Example
pn = Pathname('doc/foo') pn.mkdir pn.rmdir
Raises an exception if the entry at the path in self is not a directory, or if the directory is not empty.
Use method rmtree to delete the entire filetree at the path.