From 664674548c37561f3079c2b3565831f4533619e7 Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Thu, 5 Mar 2015 20:54:06 -0700 Subject: [PATCH 1/3] Ensure :vagrantfile_erb is path-expanded. --- lib/kitchen/driver/vagrant.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kitchen/driver/vagrant.rb b/lib/kitchen/driver/vagrant.rb index 868be125..7f6acfd9 100644 --- a/lib/kitchen/driver/vagrant.rb +++ b/lib/kitchen/driver/vagrant.rb @@ -43,6 +43,7 @@ class Vagrant < Kitchen::Driver::SSHBase default_config :vagrantfile_erb, File.join(File.dirname(__FILE__), "../../../templates/Vagrantfile.erb") + expand_path_for :vagrantfile_erb default_config :provider, ENV.fetch("VAGRANT_DEFAULT_PROVIDER", "virtualbox") From 98d23cf14a0e7a6e8cd6d5ee555379ccce07490d Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Thu, 5 Mar 2015 20:56:52 -0700 Subject: [PATCH 2/3] Lexically sort default_config attributes. --- lib/kitchen/driver/vagrant.rb | 42 ++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/lib/kitchen/driver/vagrant.rb b/lib/kitchen/driver/vagrant.rb index 7f6acfd9..f188022c 100644 --- a/lib/kitchen/driver/vagrant.rb +++ b/lib/kitchen/driver/vagrant.rb @@ -33,38 +33,44 @@ module Driver # dependency hook checks when feature is released class Vagrant < Kitchen::Driver::SSHBase + default_config :box do |driver| + "opscode-#{driver.instance.platform.name}" + end + required_config :box + + default_config :box_check_update, nil + + default_config :box_url do |driver| + driver.default_box_url + end + + default_config :box_version, nil + default_config :customize, {} + default_config :network, [] - default_config :synced_folders, [] - default_config :ssh, {} + default_config :pre_create_command, nil - default_config :vagrantfiles, [] + default_config :provision, false + default_config :provider, + ENV.fetch("VAGRANT_DEFAULT_PROVIDER", "virtualbox") + + default_config :ssh, {} + + default_config :synced_folders, [] + default_config :vagrantfile_erb, File.join(File.dirname(__FILE__), "../../../templates/Vagrantfile.erb") expand_path_for :vagrantfile_erb - default_config :provider, - ENV.fetch("VAGRANT_DEFAULT_PROVIDER", "virtualbox") + default_config :vagrantfiles, [] default_config :vm_hostname do |driver| driver.instance.name end - default_config :box do |driver| - "opscode-#{driver.instance.platform.name}" - end - - default_config :box_url do |driver| - driver.default_box_url - end - - default_config :box_version, nil - default_config :box_check_update, nil - - required_config :box - no_parallel_for :create, :destroy def create(state) From cda20618412eb435adfdd8a38f6542351d0cf8d0 Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Thu, 5 Mar 2015 21:01:27 -0700 Subject: [PATCH 3/3] Inline short default_config blocks (a style experiment). --- lib/kitchen/driver/vagrant.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/kitchen/driver/vagrant.rb b/lib/kitchen/driver/vagrant.rb index f188022c..1f87c90a 100644 --- a/lib/kitchen/driver/vagrant.rb +++ b/lib/kitchen/driver/vagrant.rb @@ -40,9 +40,7 @@ class Vagrant < Kitchen::Driver::SSHBase default_config :box_check_update, nil - default_config :box_url do |driver| - driver.default_box_url - end + default_config(:box_url) { |driver| driver.default_box_url } default_config :box_version, nil @@ -67,9 +65,7 @@ class Vagrant < Kitchen::Driver::SSHBase default_config :vagrantfiles, [] - default_config :vm_hostname do |driver| - driver.instance.name - end + default_config(:vm_hostname) { |driver| driver.instance.name } no_parallel_for :create, :destroy