Builtin class and stubbed import middleware
This commit is contained in:
parent
5775292408
commit
64b533edc4
|
@ -14,3 +14,6 @@ require File.expand_path("util/glob_loader", libdir)
|
|||
Vagrant::GlobLoader.glob_require(libdir, %w{util/stacked_proc_runner
|
||||
actions/base downloaders/base actions/collection actions/runner config
|
||||
provisioners/base provisioners/chef systems/base commands/base commands/box})
|
||||
|
||||
# Initialize the built-in actions
|
||||
Vagrant::Action.builtin!
|
||||
|
|
|
@ -15,7 +15,7 @@ module Vagrant
|
|||
#
|
||||
# @param [Symbol] key
|
||||
def register(key, callable)
|
||||
@actions[key] = callable
|
||||
actions[key] = callable
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
module Vagrant
|
||||
class Action
|
||||
# Registers the builtin actions. These are locked away in a
|
||||
# method so that their definition can be deferred until after
|
||||
# all the necessary Vagrant libraries are loaded. Hopefully
|
||||
# in the future this will no longer be necessary with autoloading.
|
||||
def self.builtin!
|
||||
up = Builder.new do
|
||||
use VM::Import
|
||||
end
|
||||
|
||||
register :up, up
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,16 @@
|
|||
module Vagrant
|
||||
class Action
|
||||
module VM
|
||||
class Import
|
||||
def initialize(app, env)
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
@app.call(env)
|
||||
p env['vm']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue