Module: Filander::EmptyDirectory

Includes:
Base
Included in:
Filander
Defined in:
lib/filander/actions/empty_directory.rb

Instance Method Summary collapse

Methods included from Base

#create_directory_for, #entries, #join_destination, #join_source, #report, #with_report

Instance Method Details

#empty_directory(destination) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/filander/actions/empty_directory.rb', line 5

def empty_directory(destination)
  dest_dir = join_destination(destination)

  if File.exists?(dest_dir)
    report :exist, destination
  else
    report :create, destination
    FileUtils.mkdir_p dest_dir
  end
end