Convert all command plugins to use the new `activated` block

This commit is contained in:
Mitchell Hashimoto 2012-05-21 22:43:13 -07:00
parent de78a3637a
commit 8846a19c70
14 changed files with 64 additions and 35 deletions

View File

@ -2,18 +2,18 @@ require "vagrant"
module VagrantPlugins
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")
name "box command"
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 }
end
end

View File

@ -2,12 +2,14 @@ require "vagrant"
module VagrantPlugins
module CommandDestroy
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "destroy command"
description "The `destroy` command destroys your virtual machines."
activated do
require File.expand_path("../command", __FILE__)
end
command("destroy") { Command }
end
end

View File

@ -2,8 +2,6 @@ require "vagrant"
module VagrantPlugins
module CommandGem
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "gem command"
description <<-DESC
@ -11,6 +9,10 @@ module VagrantPlugins
RubyGems into the Vagrant environment.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("gem") { Command }
end
end

View File

@ -2,14 +2,16 @@ require "vagrant"
module VagrantPlugins
module CommandHalt
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "halt command"
description <<-DESC
The `halt` command halts your virtual machine.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("halt") { Command }
end
end

View File

@ -2,8 +2,6 @@ require "vagrant"
module VagrantPlugins
module CommandInit
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "init command"
description <<-DESC
@ -11,6 +9,10 @@ module VagrantPlugins
Vagrant-managed environment.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("init") { Command }
end
end

View File

@ -2,8 +2,6 @@ require "vagrant"
module VagrantPlugins
module CommandPackage
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "package command"
description <<-DESC
@ -11,6 +9,10 @@ module VagrantPlugins
environment and package it into a box file.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("package") { Command }
end
end

View File

@ -2,8 +2,6 @@ require "vagrant"
module VagrantPlugins
module CommandProvision
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "provision command"
description <<-DESC
@ -11,6 +9,10 @@ module VagrantPlugins
configuration of the Vagrantfile.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("provision") { Command }
end
end

View File

@ -2,8 +2,6 @@ require "vagrant"
module VagrantPlugins
module CommandReload
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "reload command"
description <<-DESC
@ -11,6 +9,10 @@ module VagrantPlugins
the Vagrantfile, and bring it back up.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("reload") { Command }
end
end

View File

@ -2,14 +2,16 @@ require "vagrant"
module VagrantPlugins
module CommandResume
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "resume command"
description <<-DESC
The `resume` command resumes a suspend virtual machine.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("resume") { Command }
end
end

View File

@ -2,14 +2,16 @@ require "vagrant"
module VagrantPlugins
module CommandSSH
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "ssh command"
description <<-DESC
The `ssh` command provides SSH access to the virtual machine.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("ssh") { Command }
end
end

View File

@ -2,8 +2,6 @@ require "vagrant"
module VagrantPlugins
module CommandSSHConfig
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "ssh-config command"
description <<-DESC
@ -11,6 +9,10 @@ module VagrantPlugins
that can be used to quickly SSH into your virtual machine.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("ssh-config") { Command }
end
end

View File

@ -2,8 +2,6 @@ require "vagrant"
module VagrantPlugins
module CommandStatus
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "status command"
description <<-DESC
@ -11,6 +9,10 @@ module VagrantPlugins
in this environment.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("status") { Command }
end
end

View File

@ -2,14 +2,16 @@ require "vagrant"
module VagrantPlugins
module CommandSuspend
autoload :Command, File.expand_path("../command", __FILE__)
class Plugin < Vagrant.plugin("1")
name "suspend command"
description <<-DESC
The `suspend` command suspends a running virtual machine.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("suspend") { Command }
end
end

View File

@ -1,16 +1,21 @@
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 CommandUp
autoload :Command, File.expand_path("../command", __FILE__)
autoload :StartMixins, File.expand_path("../start_mixins", __FILE__)
class Plugin < Vagrant.plugin("1")
name "up command"
description <<-DESC
The `up` command brings the virtual environment up and running.
DESC
activated do
require File.expand_path("../command", __FILE__)
end
command("up") { Command }
end
end