module FileCrawler::Finder::Command::Move

Public Instance Methods

move(destination, options={dry_run: true}) click to toggle source
# File lib/file_crawler/finder/command/move.rb, line 7
def move(destination, options={dry_run: true})
  tap {
    target = @collections.empty? ? @directories : @collections
    fixer = Fixer.new
    @targets = fixer.make_new_path(target, destination)

    if !options[:dry_run]
      fixer.make_mv(@targets).each {|cmd|
        exec(cmd)
      }
    end
  }
end
output_mv() click to toggle source
# File lib/file_crawler/finder/command/move.rb, line 21
def output_mv
  return [] if @targets.nil?

  fixer = Fixer.new
  fixer.make_mv(@targets)
end