Method: FileOperations#remove_tree0

Defined in:
lib/vendor/xmpp4r/setup.rb

#remove_tree0(path) ⇒ Object



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/vendor/xmpp4r/setup.rb', line 578

def remove_tree0(path)
  Dir.foreach(path) do |ent|
    next if ent == '.'
    next if ent == '..'
    entpath = "#{path}/#{ent}"
    if File.symlink?(entpath)
      remove_file entpath
    elsif File.dir?(entpath)
      remove_tree0 entpath
    else
      force_remove_file entpath
    end
  end
  begin
    Dir.rmdir path
  rescue Errno::ENOTEMPTY
    # directory may not be empty
  end
end