Sha256: c491bb0c534119724c87b258e7c8e6d1fefca30270a9f01d95875f31661d2cfe

Contents?: true

Size: 908 Bytes

Versions: 2

Compression:

Stored size: 908 Bytes

Contents

require "log4r"

require_relative "helper"

module Vagrant
  module Zscp
    class SyncedFolder < Vagrant.plugin("2", :synced_folder)
      def initialize(*args)
        super
        @logger = Log4r::Logger.new("vagrant::synced_folders::zscp")
      end

      def usable?(machine, raise_error=false)
        return true
      end

      def prepare(machine, folders, opts)
        # Nothing is necessary to do before VM boot.
      end

      def enable(machine, folders, opts)
        ssh_info = machine.ssh_info

        folders.each do |id, folder_opts|
          sync_threads = []
          folders.each do |id, folder_opts|
            sync_threads << Thread.new(id, folder_opts) do |id, folder_opts|
              ZscpHelper.scp(machine, ssh_info, folder_opts)
            end
          end

          sync_threads.each do |t|
            t.join
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-zscp-0.1.4 lib/vagrant/zscp/synced_folder.rb
vagrant-zscp-0.1.3 lib/vagrant/zscp/synced_folder.rb