diff --git a/plugins/commands/box/plugin.rb b/plugins/commands/box/plugin.rb index 20938ed6b..1ece8a3dc 100644 --- a/plugins/commands/box/plugin.rb +++ b/plugins/commands/box/plugin.rb @@ -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 diff --git a/plugins/commands/destroy/plugin.rb b/plugins/commands/destroy/plugin.rb index 088802bcf..0bf2aa9bf 100644 --- a/plugins/commands/destroy/plugin.rb +++ b/plugins/commands/destroy/plugin.rb @@ -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 diff --git a/plugins/commands/gem/plugin.rb b/plugins/commands/gem/plugin.rb index 64960a918..bb4bce350 100644 --- a/plugins/commands/gem/plugin.rb +++ b/plugins/commands/gem/plugin.rb @@ -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 diff --git a/plugins/commands/halt/plugin.rb b/plugins/commands/halt/plugin.rb index 4710fca26..7df6b9fa6 100644 --- a/plugins/commands/halt/plugin.rb +++ b/plugins/commands/halt/plugin.rb @@ -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 diff --git a/plugins/commands/init/plugin.rb b/plugins/commands/init/plugin.rb index 862b896d0..19b04d4ca 100644 --- a/plugins/commands/init/plugin.rb +++ b/plugins/commands/init/plugin.rb @@ -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 diff --git a/plugins/commands/package/plugin.rb b/plugins/commands/package/plugin.rb index df7d814f9..8d0c20935 100644 --- a/plugins/commands/package/plugin.rb +++ b/plugins/commands/package/plugin.rb @@ -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 diff --git a/plugins/commands/provision/plugin.rb b/plugins/commands/provision/plugin.rb index eff8161e3..5a02e4ea0 100644 --- a/plugins/commands/provision/plugin.rb +++ b/plugins/commands/provision/plugin.rb @@ -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 diff --git a/plugins/commands/reload/plugin.rb b/plugins/commands/reload/plugin.rb index 9ad2056d0..e67757291 100644 --- a/plugins/commands/reload/plugin.rb +++ b/plugins/commands/reload/plugin.rb @@ -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 diff --git a/plugins/commands/resume/plugin.rb b/plugins/commands/resume/plugin.rb index b42d13761..3774adf88 100644 --- a/plugins/commands/resume/plugin.rb +++ b/plugins/commands/resume/plugin.rb @@ -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 diff --git a/plugins/commands/ssh/plugin.rb b/plugins/commands/ssh/plugin.rb index 55e5ff269..bc655c8f1 100644 --- a/plugins/commands/ssh/plugin.rb +++ b/plugins/commands/ssh/plugin.rb @@ -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 diff --git a/plugins/commands/ssh_config/plugin.rb b/plugins/commands/ssh_config/plugin.rb index ab67e0416..67a80da68 100644 --- a/plugins/commands/ssh_config/plugin.rb +++ b/plugins/commands/ssh_config/plugin.rb @@ -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 diff --git a/plugins/commands/status/plugin.rb b/plugins/commands/status/plugin.rb index 70d8d6e0e..0b14b5b89 100644 --- a/plugins/commands/status/plugin.rb +++ b/plugins/commands/status/plugin.rb @@ -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 diff --git a/plugins/commands/suspend/plugin.rb b/plugins/commands/suspend/plugin.rb index d5f30494f..bddfc80ed 100644 --- a/plugins/commands/suspend/plugin.rb +++ b/plugins/commands/suspend/plugin.rb @@ -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 diff --git a/plugins/commands/up/plugin.rb b/plugins/commands/up/plugin.rb index baac107c1..2f9b126a5 100644 --- a/plugins/commands/up/plugin.rb +++ b/plugins/commands/up/plugin.rb @@ -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