From beffce64fa12c6edf52146b0f2e9771d55d4b438 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sat, 1 Feb 2014 18:38:35 -0200 Subject: [PATCH] Add support for disabling the plugin [GH-72] --- lib/vagrant-cachier/config.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/vagrant-cachier/config.rb b/lib/vagrant-cachier/config.rb index 6fc8ec2..ac857a7 100644 --- a/lib/vagrant-cachier/config.rb +++ b/lib/vagrant-cachier/config.rb @@ -18,7 +18,6 @@ module VagrantPlugins end def enable_nfs=(value) - # TODO: Show warning!!! @ui.warn "The `enable_nfs` config for vagrant-cachier has been deprecated " \ "and will be removed on 0.7.0, please use " \ "`synced_folder_opts = { type: :nfs }` instead.\n" @@ -38,6 +37,16 @@ module VagrantPlugins { "vagrant cachier" => errors } end + def enabled? + return @enabled unless @enabled.nil? + + @enabled = (@auto_detect != UNSET_VALUE || @buckets != nil) + end + + def disable! + @enabled = false + end + def finalize! return unless enabled? @@ -46,11 +55,6 @@ module VagrantPlugins @synced_folder_opts = nil if @synced_folder_opts == UNSET_VALUE @buckets = @buckets ? @buckets.dup : {} end - - def enabled? - @enabled ||= @auto_detect != UNSET_VALUE || - @buckets != nil - end end end end