From 9593ad3fdbe17d9379ebddff91501ad4c9890937 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 19 Apr 2012 20:30:14 -0700 Subject: [PATCH] Get rid of provisioners directory --- lib/vagrant/provisioners.rb | 48 ++++++++++++++++++++++++++------ lib/vagrant/provisioners/base.rb | 44 ----------------------------- 2 files changed, 40 insertions(+), 52 deletions(-) delete mode 100644 lib/vagrant/provisioners/base.rb diff --git a/lib/vagrant/provisioners.rb b/lib/vagrant/provisioners.rb index 65046d07b..a896c2427 100644 --- a/lib/vagrant/provisioners.rb +++ b/lib/vagrant/provisioners.rb @@ -1,12 +1,44 @@ -# These aren't autoloaded because they have to register things such -# as configuration classes right away with Vagrant. module Vagrant module Provisioners - autoload :Base, 'vagrant/provisioners/base' - autoload :ChefSolo, 'vagrant/provisioners/chef_solo' - autoload :ChefClient, 'vagrant/provisioners/chef_client' - autoload :Puppet, 'vagrant/provisioners/puppet' - autoload :PuppetServer, 'vagrant/provisioners/puppet_server' - autoload :Shell, 'vagrant/provisioners/shell' + # The base class for a "provisioner." A provisioner is responsible for + # provisioning a Vagrant system. + # + # This has been abstracted out so it is easy to provide support for + # multiple solutions. + class Base + include Vagrant::Util + + # The environment which provisioner is running in. This is the + # action environment, not a Vagrant::Environment. + attr_reader :env + + # The configuration for this provisioner. This will be an instance of + # the `Config` class which is part of the provisioner. + attr_reader :config + + def initialize(env, config) + @env = env + @config = config + end + + # This method is expected to return a class that is used for configuration + # for the provisioner. + def self.config_class; end + + # This is the method called to "prepare" the provisioner. This is called + # before any actions are run by the action runner (see {Vagrant::Actions::Runner}). + # This can be used to setup shared folders, forward ports, etc. Whatever is + # necessary on a "meta" level. + def prepare; end + + # This is the method called to provision the system. This method + # is expected to do whatever necessary to provision the system (create files, + # SSH, etc.) + def provision!; end + + # This is the method called to when the system is being destroyed + # and allows the provisioners to engage in any cleanup tasks necessary. + def cleanup; end + end end end diff --git a/lib/vagrant/provisioners/base.rb b/lib/vagrant/provisioners/base.rb deleted file mode 100644 index a896c2427..000000000 --- a/lib/vagrant/provisioners/base.rb +++ /dev/null @@ -1,44 +0,0 @@ -module Vagrant - module Provisioners - # The base class for a "provisioner." A provisioner is responsible for - # provisioning a Vagrant system. - # - # This has been abstracted out so it is easy to provide support for - # multiple solutions. - class Base - include Vagrant::Util - - # The environment which provisioner is running in. This is the - # action environment, not a Vagrant::Environment. - attr_reader :env - - # The configuration for this provisioner. This will be an instance of - # the `Config` class which is part of the provisioner. - attr_reader :config - - def initialize(env, config) - @env = env - @config = config - end - - # This method is expected to return a class that is used for configuration - # for the provisioner. - def self.config_class; end - - # This is the method called to "prepare" the provisioner. This is called - # before any actions are run by the action runner (see {Vagrant::Actions::Runner}). - # This can be used to setup shared folders, forward ports, etc. Whatever is - # necessary on a "meta" level. - def prepare; end - - # This is the method called to provision the system. This method - # is expected to do whatever necessary to provision the system (create files, - # SSH, etc.) - def provision!; end - - # This is the method called to when the system is being destroyed - # and allows the provisioners to engage in any cleanup tasks necessary. - def cleanup; end - end - end -end