Convert all command plugins to use the new `activated` block
This commit is contained in:
parent
de78a3637a
commit
8846a19c70
|
@ -2,18 +2,18 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandBox
|
module CommandBox
|
||||||
module Command
|
|
||||||
autoload :Root, File.expand_path("../command/root", __FILE__)
|
|
||||||
autoload :Add, File.expand_path("../command/add", __FILE__)
|
|
||||||
autoload :List, File.expand_path("../command/list", __FILE__)
|
|
||||||
autoload :Remove, File.expand_path("../command/remove", __FILE__)
|
|
||||||
autoload :Repackage, File.expand_path("../command/repackage", __FILE__)
|
|
||||||
end
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "box command"
|
name "box command"
|
||||||
description "The `box` command gives you a way to manage boxes."
|
description "The `box` command gives you a way to manage boxes."
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command/root", __FILE__)
|
||||||
|
require File.expand_path("../command/add", __FILE__)
|
||||||
|
require File.expand_path("../command/list", __FILE__)
|
||||||
|
require File.expand_path("../command/remove", __FILE__)
|
||||||
|
require File.expand_path("../command/repackage", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("box") { Command::Root }
|
command("box") { Command::Root }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,12 +2,14 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandDestroy
|
module CommandDestroy
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "destroy command"
|
name "destroy command"
|
||||||
description "The `destroy` command destroys your virtual machines."
|
description "The `destroy` command destroys your virtual machines."
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("destroy") { Command }
|
command("destroy") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,6 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandGem
|
module CommandGem
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "gem command"
|
name "gem command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
|
@ -11,6 +9,10 @@ module VagrantPlugins
|
||||||
RubyGems into the Vagrant environment.
|
RubyGems into the Vagrant environment.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("gem") { Command }
|
command("gem") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,14 +2,16 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandHalt
|
module CommandHalt
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "halt command"
|
name "halt command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
The `halt` command halts your virtual machine.
|
The `halt` command halts your virtual machine.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("halt") { Command }
|
command("halt") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,6 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandInit
|
module CommandInit
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "init command"
|
name "init command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
|
@ -11,6 +9,10 @@ module VagrantPlugins
|
||||||
Vagrant-managed environment.
|
Vagrant-managed environment.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("init") { Command }
|
command("init") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,6 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandPackage
|
module CommandPackage
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "package command"
|
name "package command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
|
@ -11,6 +9,10 @@ module VagrantPlugins
|
||||||
environment and package it into a box file.
|
environment and package it into a box file.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("package") { Command }
|
command("package") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,6 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandProvision
|
module CommandProvision
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "provision command"
|
name "provision command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
|
@ -11,6 +9,10 @@ module VagrantPlugins
|
||||||
configuration of the Vagrantfile.
|
configuration of the Vagrantfile.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("provision") { Command }
|
command("provision") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,6 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandReload
|
module CommandReload
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "reload command"
|
name "reload command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
|
@ -11,6 +9,10 @@ module VagrantPlugins
|
||||||
the Vagrantfile, and bring it back up.
|
the Vagrantfile, and bring it back up.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("reload") { Command }
|
command("reload") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,14 +2,16 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandResume
|
module CommandResume
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "resume command"
|
name "resume command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
The `resume` command resumes a suspend virtual machine.
|
The `resume` command resumes a suspend virtual machine.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("resume") { Command }
|
command("resume") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,14 +2,16 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandSSH
|
module CommandSSH
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "ssh command"
|
name "ssh command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
The `ssh` command provides SSH access to the virtual machine.
|
The `ssh` command provides SSH access to the virtual machine.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("ssh") { Command }
|
command("ssh") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,6 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandSSHConfig
|
module CommandSSHConfig
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "ssh-config command"
|
name "ssh-config command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
|
@ -11,6 +9,10 @@ module VagrantPlugins
|
||||||
that can be used to quickly SSH into your virtual machine.
|
that can be used to quickly SSH into your virtual machine.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("ssh-config") { Command }
|
command("ssh-config") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,6 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandStatus
|
module CommandStatus
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "status command"
|
name "status command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
|
@ -11,6 +9,10 @@ module VagrantPlugins
|
||||||
in this environment.
|
in this environment.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("status") { Command }
|
command("status") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,14 +2,16 @@ require "vagrant"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandSuspend
|
module CommandSuspend
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "suspend command"
|
name "suspend command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
The `suspend` command suspends a running virtual machine.
|
The `suspend` command suspends a running virtual machine.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("suspend") { Command }
|
command("suspend") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
require "vagrant"
|
require "vagrant"
|
||||||
|
|
||||||
|
# These are used by various other commands, so we just load them
|
||||||
|
# up right away.
|
||||||
|
require File.expand_path("../start_mixins", __FILE__)
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module CommandUp
|
module CommandUp
|
||||||
autoload :Command, File.expand_path("../command", __FILE__)
|
|
||||||
autoload :StartMixins, File.expand_path("../start_mixins", __FILE__)
|
|
||||||
|
|
||||||
class Plugin < Vagrant.plugin("1")
|
class Plugin < Vagrant.plugin("1")
|
||||||
name "up command"
|
name "up command"
|
||||||
description <<-DESC
|
description <<-DESC
|
||||||
The `up` command brings the virtual environment up and running.
|
The `up` command brings the virtual environment up and running.
|
||||||
DESC
|
DESC
|
||||||
|
|
||||||
|
activated do
|
||||||
|
require File.expand_path("../command", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
command("up") { Command }
|
command("up") { Command }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue