public Method

FileUtils.rmdir(list, options = {})

Options: noop, verbose

Removes one or more directories.

FileUtils.rmdir 'somedir'
FileUtils.rmdir %w(somedir anydir otherdir)
# Does not really remove directory; outputs message.
FileUtils.rmdir 'somedir', :verbose => true, :noop => true

Source Code

# File fileutils.rb, line 258
def rmdir(list, options = {})
  fu_check_options options, OPT_TABLE['rmdir']
  list = fu_list(list)
  fu_output_message "rmdir #{list.join ' '}" if options[:verbose]
  return if options[:noop]
  list.each do |dir|
    Dir.rmdir dir.sub(%r</\z>, '')
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.