Class: VagrantPlugins::SyncedFolderRSyncPull::SyncedFolder
- Inherits:
-
Object
- Object
- VagrantPlugins::SyncedFolderRSyncPull::SyncedFolder
- Includes:
- Vagrant::Util
- Defined in:
- lib/vagrant-rsync-pull/synced_folder.rb
Instance Method Summary collapse
- #enable(machine, folders, opts) ⇒ Object
-
#initialize(*args) ⇒ SyncedFolder
constructor
A new instance of SyncedFolder.
- #prepare(machine, folders, opts) ⇒ Object
- #usable?(machine, raise_error = false) ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ SyncedFolder
Returns a new instance of SyncedFolder.
13 14 15 16 17 |
# File 'lib/vagrant-rsync-pull/synced_folder.rb', line 13 def initialize(*args) super @logger = Log4r::Logger.new("vagrant_rsync_pull") end |
Instance Method Details
#enable(machine, folders, opts) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/vagrant-rsync-pull/synced_folder.rb', line 29 def enable(machine, folders, opts) if machine.guest.capability?(:rsync_installed) installed = machine.guest.capability(:rsync_installed) if !installed can_install = machine.guest.capability?(:rsync_install) raise Vagrant::Errors::RSyncNotInstalledInGuest if !can_install machine.ui.info I18n.t("vagrant.rsync_installing") machine.guest.capability(:rsync_install) end end ssh_info = machine.ssh_info if ssh_info[:private_key_path].empty? && ssh_info[:password] machine.ui.warn(I18n.t("vagrant.rsync_ssh_password")) end folders.each do |id, folder_opts| RsyncPullHelper.rsync_single(machine, folder_opts) end end |
#prepare(machine, folders, opts) ⇒ Object
26 27 |
# File 'lib/vagrant-rsync-pull/synced_folder.rb', line 26 def prepare(machine, folders, opts) end |