How to rename a directory?
How do I rename a directory in Ruby?
I see how to rename individual fil开发者_开发问答es, but not folders.File.rename
will let you rename directories:
File.rename './my-directory', './my-renamed-directory'
FileUtils.mv old_name, new_name
Check the docs for more info
require 'fileutils'
FileUtils.mv sourcedir, newdir
精彩评论