diff --git a/plugins/provisioners/chef/config/chef_client.rb b/plugins/provisioners/chef/config/chef_client.rb index 9684d2b0e..e1585c084 100644 --- a/plugins/provisioners/chef/config/chef_client.rb +++ b/plugins/provisioners/chef/config/chef_client.rb @@ -1,7 +1,7 @@ -require File.expand_path("../base", __FILE__) - require "vagrant/util/which" +require_relative "base" + module VagrantPlugins module Chef module Config diff --git a/plugins/provisioners/chef/config/chef_solo.rb b/plugins/provisioners/chef/config/chef_solo.rb index 59c3b858e..e8e5c8e04 100644 --- a/plugins/provisioners/chef/config/chef_solo.rb +++ b/plugins/provisioners/chef/config/chef_solo.rb @@ -1,4 +1,4 @@ -require File.expand_path("../base", __FILE__) +require_relative "base" module VagrantPlugins module Chef diff --git a/plugins/provisioners/chef/plugin.rb b/plugins/provisioners/chef/plugin.rb index 0a771f300..817de36a3 100644 --- a/plugins/provisioners/chef/plugin.rb +++ b/plugins/provisioners/chef/plugin.rb @@ -2,11 +2,10 @@ require "pathname" require "vagrant" +require_relative "command_builder" + module VagrantPlugins module Chef - root = Pathname.new(File.expand_path("../", __FILE__)) - autoload :CommandBuilder, root.join("command_builder") - class Plugin < Vagrant.plugin("2") name "chef" description <<-DESC @@ -15,32 +14,32 @@ module VagrantPlugins DESC config(:chef_solo, :provisioner) do - require File.expand_path("../config/chef_solo", __FILE__) + require_relative "config/chef_solo" Config::ChefSolo end config(:chef_client, :provisioner) do - require File.expand_path("../config/chef_client", __FILE__) + require_relative "config/chef_client" Config::ChefClient end config(:chef_zero, :provisioner) do - require File.expand_path("../config/chef_zero", __FILE__) + require_relative "config/chef_zero" Config::ChefZero end provisioner(:chef_solo) do - require File.expand_path("../provisioner/chef_solo", __FILE__) + require_relative "provisioner/chef_solo" Provisioner::ChefSolo end provisioner(:chef_client) do - require File.expand_path("../provisioner/chef_client", __FILE__) + require_relative "provisioner/chef_client" Provisioner::ChefClient end provisioner(:chef_zero) do - require File.expand_path("../provisioner/chef_zero", __FILE__) + require_relative "provisioner/chef_zero" Provisioner::ChefZero end end diff --git a/plugins/provisioners/chef/provisioner/chef_client.rb b/plugins/provisioners/chef/provisioner/chef_client.rb index d91b3c22c..9b0c2341f 100644 --- a/plugins/provisioners/chef/provisioner/chef_client.rb +++ b/plugins/provisioners/chef/provisioner/chef_client.rb @@ -3,7 +3,7 @@ require 'pathname' require 'vagrant' require 'vagrant/util/subprocess' -require File.expand_path("../base", __FILE__) +require_relative "base" module VagrantPlugins module Chef diff --git a/plugins/provisioners/chef/provisioner/chef_solo.rb b/plugins/provisioners/chef/provisioner/chef_solo.rb index e93ba7f5b..a8c1e84d3 100644 --- a/plugins/provisioners/chef/provisioner/chef_solo.rb +++ b/plugins/provisioners/chef/provisioner/chef_solo.rb @@ -2,7 +2,7 @@ require "log4r" require "vagrant/util/counter" -require File.expand_path("../base", __FILE__) +require_relative "base" module VagrantPlugins module Chef