This shows me moving the built-in middleware sequences to the provider and how I'm organizing all that.
22 lines
445 B
Ruby
22 lines
445 B
Ruby
module Vagrant
|
|
module Action
|
|
module General
|
|
# Simply validates the configuration of the current Vagrant
|
|
# environment.
|
|
class Validate
|
|
def initialize(app, env)
|
|
@app = app
|
|
end
|
|
|
|
def call(env)
|
|
if !env.has_key?(:validate) || env[:validate]
|
|
env[:machine].config.validate!(env[:machine].env)
|
|
end
|
|
|
|
@app.call(env)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|