module Vagrant::Plugin::Remote

Attributes

real_manager[R]

@return [V2::Manager]

Public Class Methods

new(manager) click to toggle source

Create a new remote plugin manager

@param manager [V2::Manger] @return [Remote::Manager]

# File lib/vagrant/plugin/remote/manager.rb, line 131
def initialize(manager)
  @logger = Log4r::Logger.new(self.class.name.downcase)
  @real_manager = manager
end

Public Instance Methods

commands() click to toggle source

This returns all command implementations.

@return [Registry]

# File lib/vagrant/plugin/remote/manager.rb, line 175
def commands
  Registry.new.tap do |result|
    plugin_manager.list_plugins(:command).each do |plg|
      sf_class = Class.new(Remote::Command, &WRAPPER_CLASS)
      sf_class.plugin_name = plg[:name]
      sf_class.type = plg[:type]
      result.register(plg[:name].to_sym) do
        [proc{sf_class}, plg[:options]]
      end
    end
  end
end
communicators() click to toggle source

This returns all communicator implementations.

@return [Registry]

# File lib/vagrant/plugin/remote/manager.rb, line 191
def communicators
  Registry.new.tap do |result|
    plugin_manager.list_plugins(:communicator).each do |plg|
      sf_class = Class.new(Remote::Communicator, &WRAPPER_CLASS)
      sf_class.plugin_name = plg[:name]
      sf_class.type = plg[:type]
      result.register(plg[:name].to_sym) do
        proc{sf_class}
      end
    end
  end
end
core_plugin_manager() click to toggle source

@return [VagrantPlugins::Command::Serve::Client::CorePluginManager] remote core manager client

# File lib/vagrant/plugin/remote/manager.rb, line 147
def core_plugin_manager
  self.class.core_client
end
guests() click to toggle source

This returns all guest implementations.

@return [Registry]

# File lib/vagrant/plugin/remote/manager.rb, line 222
def guests
  Registry.new.tap do |result|
    plugin_manager.list_plugins(:guest).each do |plg|
      sf_class = Class.new(Remote::Guest, &WRAPPER_CLASS)
      sf_class.plugin_name = plg[:name]
      sf_class.type = plg[:type]
      result.register(plg[:name].to_sym) do
        proc{sf_class}
      end
    end
  end
end
hosts() click to toggle source

This returns all host implementations.

@return [Registry]

# File lib/vagrant/plugin/remote/manager.rb, line 238
def hosts
  Registry.new.tap do |result|
    plugin_manager.list_plugins(:host).each do |plg|
      sf_class = Class.new(Remote::Host, &WRAPPER_CLASS)
      sf_class.plugin_name = plg[:name]
      sf_class.type = plg[:type]
      result.register(plg[:name].to_sym) do
        proc{sf_class}
      end
    end
  end
end
method_missing(m, *args, **kwargs, &block) click to toggle source
# File lib/vagrant/plugin/remote/manager.rb, line 136
def method_missing(m, *args, **kwargs, &block)
  @logger.debug("method not defined, sending to real manager `#{m}'")
  @real_manager.send(m, *args, **kwargs, &block)
end
plugin_manager() click to toggle source

@return [VagrantPlugins::Command::Serve::Client::PluginManager] remote manager client

# File lib/vagrant/plugin/remote/manager.rb, line 142
def plugin_manager
  self.class.client
end
providers() click to toggle source

This returns all provider implementations.

@return [Registry]

# File lib/vagrant/plugin/remote/manager.rb, line 254
def providers
  Registry.new.tap do |result|
    plugin_manager.list_plugins(:provider).each do |plg|
      sf_class = Class.new(Remote::Provider, &WRAPPER_CLASS)
      sf_class.plugin_name = plg[:name]
      sf_class.type = plg[:type]
      result.register(plg[:name].to_sym) do
        [sf_class, plg[:options]]
      end
    end
  end
end
provisioners() click to toggle source
# File lib/vagrant/plugin/remote/manager.rb, line 267
def provisioners
  return real_manager.provisioners if plugin_manager.nil?

  Registry.new.tap do |result|
    plugin_manager.list_plugins(:provisioner).each do |plg|
      sf_class = Class.new(Remote::Provisioner, &WRAPPER_CLASS)
      sf_class.plugin_name = plg[:name]
      sf_class.type = plg[:type]
      result.register(plg[:name].to_sym) do
        sf_class
      end
    end
  end
end
pushes() click to toggle source

This returns all push implementations.

@return [Registry]

# File lib/vagrant/plugin/remote/manager.rb, line 285
def pushes
  Registry.new.tap do |result|
    plugin_manager.list_plugins(:push).each do |plg|
      sf_class = Class.new(Remote::Push, &WRAPPER_CLASS)
      sf_class.plugin_name = plg[:name]
      sf_class.type = plg[:type]
      result.register(plg[:name].to_sym) do
        sf_class
      end
    end
  end
end
synced_folders() click to toggle source

This returns all synced folder implementations.

@return [Registry]

# File lib/vagrant/plugin/remote/manager.rb, line 154
def synced_folders
  Registry.new.tap do |result|
    plugin_manager.list_plugins(:synced_folder).each do |plg|
      sf_class = Class.new(Remote::SyncedFolder, &WRAPPER_CLASS)
      sf_class.plugin_name = plg[:name]
      sf_class.type = plg[:type]
      result.register(plg[:name].to_sym) do
        # The integer priority has already been captured on the Go side
        # by InternalService#get_plugins. It's returned in the plugin
        # options field, and we populate it into the same place for
        # good measure, even though we expect that priority will be
        # handled on the Go side now.
        [sf_class, plg[:options]]
      end
    end
  end
end