Fix 1.8.7 compatibility issue
This commit is contained in:
parent
658affe8cd
commit
f7666df24b
|
@ -18,12 +18,17 @@ module Vagrant
|
|||
|
||||
# Configures the provisioner if it can (if it is valid).
|
||||
def configure(options=nil, &block)
|
||||
# We don't want ancestors to be searched. This is the default in 1.8,
|
||||
# but not in 1.9, hence this hackery.
|
||||
const_args = ["Config"]
|
||||
const_args << false if RUBY_VERSION >= "1.9"
|
||||
|
||||
# We assume that every provisioner has a `Config` class beneath
|
||||
# it for configuring.
|
||||
return if !@provisioner || !@provisioner.const_defined?("Config", false)
|
||||
return if !@provisioner || !@provisioner.const_defined?(*const_args)
|
||||
|
||||
# Instantiate the config class and configure it
|
||||
@config = @provisioner.const_get("Config", false).new
|
||||
@config = @provisioner.const_get(*const_args).new
|
||||
block.call(@config) if block
|
||||
|
||||
# TODO: Deal with the options hash
|
||||
|
|
Loading…
Reference in New Issue