lib/vos/helpers/ubuntu.rb in vos-0.3.15 vs lib/vos/helpers/ubuntu.rb in vos-0.4.0
- old
+ new
@@ -35,29 +35,25 @@
module Vfs
class Entry
def symlink_to entry, options = {}
raise "invalid argument!" unless entry.is_a? Entry
- raise "can't use symlink ('#{self}' and '#{entry}' are on different storages)!" if self.storage != entry.storage
- raise "symlink target '' not exist!" unless entry.exist?
- storage.bash "ln -s#{'f' if options[:override]} #{entry.path} #{path}"
+ raise "can't use symlink ('#{self}' and '#{entry}' are on different storages)!" if self.driver != entry.driver
+ raise "symlink target '#{entry}' not exist!" unless entry.exist?
+ driver.box.bash "ln -sf #{entry.path} #{path}"
end
-
- def symlink_to! entry
- symlink_to entry, override: true
- end
end
class Dir
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.storage.host}:#{entry.path}")
+ 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@#{storage.host}:#{path}/ #{entry.path}")
+ Box.local.bash("rsync -e 'ssh' -al --delete --stats --progress root@#{driver.host}:#{path}/ #{entry.path}")
else
raise "invalid usage!"
end
end
end
\ No newline at end of file