Class: Vfs::Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/vos/box/vfs.rb,
lib/vos/helpers/ubuntu.rb

Instance Method Summary collapse

Instance Method Details

#bash(cmd, *args) ⇒ Object



40
41
42
# File 'lib/vos/box/vfs.rb', line 40

def bash cmd, *args
  driver.box.bash_without_path "cd #{path} && #{cmd}", *args
end

#rsync_to(entry) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/vos/helpers/ubuntu.rb', line 47

def rsync_to entry
  raise "invalid argument!" unless entry.is_a? Entry
  raise "#{path} must be a Dir" unless dir?
  raise "#{entry.path} can't be a File!" if entry.file?

  if local? and !entry.local?
    Box.local.bash("rsync -e 'ssh' -al --delete --stats --progress #{path}/ root@#{entry.driver.host}:#{entry.path}")
  elsif entry.local? and !local?
    Box.local.bash("rsync -e 'ssh' -al --delete --stats --progress root@#{driver.host}:#{path}/ #{entry.path}")
  else
    raise "invalid usage!"
  end
end