To delete a folder in Ruby you can use the following snippet.
Sample Ruby
import os os.rmdir(ourdir) #use with an empty dir import shutil shutil.rmtree(ourdir) #use with a non empty dir
To delete a folder in Ruby you can use the following snippet.
import os os.rmdir(ourdir) #use with an empty dir import shutil shutil.rmtree(ourdir) #use with a non empty dir
To delete a file in Ruby you can use the following snippet.
File.delete('filePath')
To rename a file or folder in Ruby you can use the following snippet.
begin File.rename("/path/to/oldfile", "/path/to/newfile") rescue Exception => e # the exception your way end