Top Level Namespace

Defined Under Namespace

Modules: PaliCanon

Instance Method Summary collapse

Instance Method Details

#move_directory_conents_here_with_removing_all_files_and_dirs_found_nearby(dir, params) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/pali-canon.rb', line 33

def move_directory_conents_here_with_removing_all_files_and_dirs_found_nearby dir, params
  raise 'Danger!' unless params[:danger] == true
  (Dir['*'] - [dir]).each do |source|
    File.directory?(source) ? rm_r(source) : File.delete(source)
  end
  cp_r "#{dir}/.", '.'
  rm_r dir unless Dir.exist? "#{dir}/#{dir}"
end