Class: Cleaner::Actions::Move

Inherits:
Cleaner::Action show all
Defined in:
lib/cleaner/actions/move.rb

Instance Attribute Summary

Attributes inherited from Cleaner::Action

#files, #options

Instance Method Summary collapse

Methods inherited from Cleaner::Action

#initialize

Constructor Details

This class inherits a constructor from Cleaner::Action

Instance Method Details

#executeObject



4
5
6
7
8
# File 'lib/cleaner/actions/move.rb', line 4

def execute
  dest = File.expand_path(options[:to])
  FileUtils.mkdir_p(dest)
  files.each { |src| FileUtils.mv(src, dest) }
end