class => module Action

This commit is contained in:
Mitchell Hashimoto 2011-12-09 17:23:27 -08:00
parent 3edb9c2269
commit b878f1bd66
45 changed files with 45 additions and 47 deletions

View File

@ -1,10 +1,8 @@
require 'log4r'
require 'vagrant/action/builder' require 'vagrant/action/builder'
require 'vagrant/action/builtin' require 'vagrant/action/builtin'
module Vagrant module Vagrant
class Action module Action
autoload :Environment, 'vagrant/action/environment' autoload :Environment, 'vagrant/action/environment'
autoload :Registry, 'vagrant/action/registry' autoload :Registry, 'vagrant/action/registry'
autoload :Runner, 'vagrant/action/runner' autoload :Runner, 'vagrant/action/runner'

View File

@ -1,7 +1,7 @@
require 'fileutils' require 'fileutils'
module Vagrant module Vagrant
class Action module Action
module Box module Box
class Destroy class Destroy
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module Box module Box
class Download class Download
BASENAME = "box" BASENAME = "box"

View File

@ -1,7 +1,7 @@
require 'vagrant/action/general/package' require 'vagrant/action/general/package'
module Vagrant module Vagrant
class Action module Action
module Box module Box
# Packages a box which has already been unpackaged (such as # Packages a box which has already been unpackaged (such as
# for the `vagrant box repackage` command) by leveraging the # for the `vagrant box repackage` command) by leveraging the

View File

@ -2,7 +2,7 @@ require 'fileutils'
require 'archive/tar/minitar' require 'archive/tar/minitar'
module Vagrant module Vagrant
class Action module Action
module Box module Box
# Unpackages a downloaded box to a given directory with a given # Unpackages a downloaded box to a given directory with a given
# name. # name.

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module Box module Box
class Verify class Verify
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
# Action builder which provides a nice DSL for building up # Action builder which provides a nice DSL for building up
# a middleware sequence for Vagrant actions. This code is based # a middleware sequence for Vagrant actions. This code is based
# heavily off of `Rack::Builder` and `ActionDispatch::MiddlewareStack` # heavily off of `Rack::Builder` and `ActionDispatch::MiddlewareStack`

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
# Registers the builtin actions with a specific registry. # Registers the builtin actions with a specific registry.
# #
# These are the pre-built action sequences that are shipped with # These are the pre-built action sequences that are shipped with

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module Env module Env
# A middleware which just sets up the environment with some # A middleware which just sets up the environment with some
# options which are passed to it. # options which are passed to it.

View File

@ -1,7 +1,7 @@
require 'vagrant/util/hash_with_indifferent_access' require 'vagrant/util/hash_with_indifferent_access'
module Vagrant module Vagrant
class Action module Action
# Represents an action environment which is what is passed # Represents an action environment which is what is passed
# to the `call` method of each action. This environment contains # to the `call` method of each action. This environment contains
# some helper methods for accessing the environment as well # some helper methods for accessing the environment as well

View File

@ -2,7 +2,7 @@ require 'fileutils'
require 'archive/tar/minitar' require 'archive/tar/minitar'
module Vagrant module Vagrant
class Action module Action
module General module General
# A general packaging (tar) middleware. Given the following options, # A general packaging (tar) middleware. Given the following options,
# it will do the right thing: # it will do the right thing:

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module General module General
# Simply validates the configuration of the current Vagrant # Simply validates the configuration of the current Vagrant
# environment. # environment.

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
# This is the action registry, which stores action steps indexed # This is the action registry, which stores action steps indexed
# by a unique name. These registry names can be used to call actions # by a unique name. These registry names can be used to call actions
# via the `Runner` class. # via the `Runner` class.

View File

@ -6,7 +6,7 @@ require 'vagrant/util/busy'
# * env.lock # * env.lock
module Vagrant module Vagrant
class Action module Action
class Runner class Runner
@@reported_interrupt = false @@reported_interrupt = false

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Boot class Boot
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class CheckAccessible class CheckAccessible
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class CheckBox class CheckBox
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
# Middleware which verifies that the VM has the proper guest additions # Middleware which verifies that the VM has the proper guest additions
# installed and prints a warning if they're not detected or if the # installed and prints a warning if they're not detected or if the

View File

@ -1,7 +1,7 @@
require 'fileutils' require 'fileutils'
module Vagrant module Vagrant
class Action module Action
module VM module VM
# Cleans up the VirtualBox machine folder for any ".xml-prev" # Cleans up the VirtualBox machine folder for any ".xml-prev"
# files which VirtualBox may have left over. This is a bug in # files which VirtualBox may have left over. This is a bug in

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class ClearForwardedPorts class ClearForwardedPorts
def initialize(app, env) def initialize(app, env)

View File

@ -1,7 +1,7 @@
require File.expand_path("../nfs_helpers", __FILE__) require File.expand_path("../nfs_helpers", __FILE__)
module Vagrant module Vagrant
class Action module Action
module VM module VM
class ClearNFSExports class ClearNFSExports
include NFSHelpers include NFSHelpers

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class ClearSharedFolders class ClearSharedFolders
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Customize class Customize
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Destroy class Destroy
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
# Destroys the unused host only interfaces. This middleware cleans # Destroys the unused host only interfaces. This middleware cleans
# up any created host only networks. # up any created host only networks.

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
# Discards the saved state of the VM if its saved. If its # Discards the saved state of the VM if its saved. If its
# not saved, does nothing. # not saved, does nothing.

View File

@ -1,7 +1,7 @@
require 'fileutils' require 'fileutils'
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Export class Export
attr_reader :temp_dir attr_reader :temp_dir

View File

@ -1,7 +1,7 @@
require File.join(File.dirname(__FILE__), 'forward_ports_helpers') require File.join(File.dirname(__FILE__), 'forward_ports_helpers')
module Vagrant module Vagrant
class Action module Action
module VM module VM
class ForwardPorts class ForwardPorts
include ForwardPortsHelpers include ForwardPortsHelpers

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
# Helper methods for forwarding ports. Requires that the environment # Helper methods for forwarding ports. Requires that the environment
# is set to the `@env` instance variable. # is set to the `@env` instance variable.

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Halt class Halt
def initialize(app, env, options=nil) def initialize(app, env, options=nil)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class HostName class HostName
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Import class Import
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class MatchMACAddress class MatchMACAddress
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
# This class allows other actions on the virtual machine object # This class allows other actions on the virtual machine object
# to be consolidated under a single write lock. This vastly speeds # to be consolidated under a single write lock. This vastly speeds

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
# Networking middleware for Vagrant. This enables host only # Networking middleware for Vagrant. This enables host only
# networking on VMs if configured as such. # networking on VMs if configured as such.

View File

@ -1,7 +1,7 @@
require File.expand_path("../nfs_helpers", __FILE__) require File.expand_path("../nfs_helpers", __FILE__)
module Vagrant module Vagrant
class Action module Action
module VM module VM
# Enables NFS based shared folders. `nfsd` must already be installed # Enables NFS based shared folders. `nfsd` must already be installed
# on the host machine, and NFS client must already be installed on # on the host machine, and NFS client must already be installed on

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
module NFSHelpers module NFSHelpers
def clear_nfs_exports(env) def clear_nfs_exports(env)

View File

@ -1,7 +1,7 @@
require 'vagrant/action/general/package' require 'vagrant/action/general/package'
module Vagrant module Vagrant
class Action module Action
module VM module VM
# A subclass of {General::Package} which simply makes sure that # A subclass of {General::Package} which simply makes sure that
# the package directory is set to the directory which the VM # the package directory is set to the directory which the VM

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
# Puts a generated Vagrantfile into the package directory so that # Puts a generated Vagrantfile into the package directory so that
# it can be included in the package. # it can be included in the package.

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Provision class Provision
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class ProvisionerCleanup class ProvisionerCleanup
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Resume class Resume
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class ShareFolders class ShareFolders
def initialize(app, env) def initialize(app, env)

View File

@ -1,5 +1,5 @@
module Vagrant module Vagrant
class Action module Action
module VM module VM
class Suspend class Suspend
def initialize(app, env) def initialize(app, env)

View File

@ -1,7 +1,7 @@
require "log4r" require "log4r"
module Vagrant module Vagrant
class Action module Action
# The action warden is a middleware which injects itself between # The action warden is a middleware which injects itself between
# every other middleware, watching for exceptions which are raised # every other middleware, watching for exceptions which are raised
# and performing proper cleanup on every action by calling the `recover` # and performing proper cleanup on every action by calling the `recover`