Class: VagrantPlugins::ScpSync::SyncedFolder
- Inherits:
-
Object
- Object
- VagrantPlugins::ScpSync::SyncedFolder
- Includes:
- Vagrant::Util
- Defined in:
- lib/vagrant-scp-sync/synced_folder.rb
Overview
This Class prepares the environment for SCP Sync
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, *args) ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ SyncedFolder
Returns a new instance of SyncedFolder.
15 16 17 18 19 |
# File 'lib/vagrant-scp-sync/synced_folder.rb', line 15 def initialize(*args) super @logger = Log4r::Logger.new('vagrant_scp_sync') end |
Instance Method Details
#enable(machine, folders, _opts) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/vagrant-scp-sync/synced_folder.rb', line 32 def enable(machine, folders, _opts) ssh_info = machine.ssh_info scp_path = Which.which('scp') machine.ui.warn(I18n.t('vagrant.scp_ssh_password')) if ssh_info[:private_key_path].empty? && ssh_info[:password] folders.each_value do |folder_opts| ScpSyncHelper.scp_single(machine, folder_opts, scp_path) end end |
#prepare(machine, folders, opts) ⇒ Object
30 |
# File 'lib/vagrant-scp-sync/synced_folder.rb', line 30 def prepare(machine, folders, opts); end |
#usable?(_machine, *args) ⇒ Boolean
21 22 23 24 25 26 27 28 |
# File 'lib/vagrant-scp-sync/synced_folder.rb', line 21 def usable?(_machine, *args) scp_path = Which.which('scp') return true if scp_path return false unless args.include?(:raise_error) && args[:raise_error] raise Vagrant::Errors::SCPNotFound end |