config.vm.provider (although it doesn't do anything yet)

This commit is contained in:
Mitchell Hashimoto 2012-11-07 20:38:41 -08:00
parent f52f8ecc97
commit 83e99bbe4e
2 changed files with 27 additions and 0 deletions

View File

@ -2,6 +2,7 @@ require "pathname"
require "vagrant"
require File.expand_path("../vm_provider", __FILE__)
require File.expand_path("../vm_provisioner", __FILE__)
require File.expand_path("../vm_subvm", __FILE__)
@ -20,6 +21,7 @@ module VagrantPlugins
attr_reader :forwarded_ports
attr_reader :shared_folders
attr_reader :networks
attr_reader :providers
attr_reader :provisioners
attr_reader :customizations
attr_accessor :guest
@ -28,6 +30,7 @@ module VagrantPlugins
@forwarded_ports = []
@shared_folders = {}
@networks = []
@providers = []
@provisioners = []
@customizations = []
end
@ -71,6 +74,13 @@ module VagrantPlugins
@networks << [type, args]
end
# Configures a provider for this VM.
#
# @param [Symbol] name The name of the provider.
def provider(name)
@providers << VagrantConfigProvider.new(name)
end
def provision(name, options=nil, &block)
@provisioners << VagrantConfigProvisioner.new(name, options, &block)
end

View File

@ -0,0 +1,17 @@
module VagrantPlugins
module Kernel_V2
# Represents a single configured provider for a VM. This may or may
# not be a valid provider.
class VagrantConfigProvider
attr_reader :name
# Initializes a new provider configuration for a VM. This should
# only be instantiated internally by calling `config.vm.provider`.
#
# @param [Symbol] name The name of the provider that is registered.
def initialize(name)
@name = name
end
end
end
end