diff --git a/lib/vagrant.rb b/lib/vagrant.rb index be0d4e465..28ce5a741 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -1,8 +1,6 @@ -# First, load the various libs which Vagrant requires -%w{tempfile json pathname logger virtualbox net/ssh archive/tar/minitar - net/scp fileutils mario}.each do |lib| - require lib -end +require 'json' +require 'virtualbox' +require "vagrant/util/glob_loader" module Vagrant class << self @@ -14,10 +12,8 @@ module Vagrant end end -# Then load the glob loader, which will handle loading everything else -require "vagrant/util/glob_loader" - -# Load them up +# Load them up. One day we'll convert this to autoloads. Today +# is not that day. Low hanging fruit for anyone wishing to do it. libdir = File.expand_path("lib/vagrant", Vagrant.source_root) Vagrant::GlobLoader.glob_require(libdir, %w{util util/stacked_proc_runner downloaders/base config provisioners/base provisioners/chef systems/base diff --git a/lib/vagrant/action/box/destroy.rb b/lib/vagrant/action/box/destroy.rb index 36cdacafd..28d36458f 100644 --- a/lib/vagrant/action/box/destroy.rb +++ b/lib/vagrant/action/box/destroy.rb @@ -1,3 +1,5 @@ +require 'fileutils' + module Vagrant class Action module Box diff --git a/lib/vagrant/action/box/unpackage.rb b/lib/vagrant/action/box/unpackage.rb index 79f832ab5..87899daec 100644 --- a/lib/vagrant/action/box/unpackage.rb +++ b/lib/vagrant/action/box/unpackage.rb @@ -1,3 +1,6 @@ +require 'fileutils' +require 'archive/tar/minitar' + module Vagrant class Action module Box diff --git a/lib/vagrant/action/general/package.rb b/lib/vagrant/action/general/package.rb index 40bbe9de8..a16f9ffb4 100644 --- a/lib/vagrant/action/general/package.rb +++ b/lib/vagrant/action/general/package.rb @@ -1,3 +1,6 @@ +require 'fileutils' +require 'archive/tar/minitar' + module Vagrant class Action module General diff --git a/lib/vagrant/action/vm/export.rb b/lib/vagrant/action/vm/export.rb index e4c7e0909..0c69ed52f 100644 --- a/lib/vagrant/action/vm/export.rb +++ b/lib/vagrant/action/vm/export.rb @@ -1,3 +1,5 @@ +require 'fileutils' + module Vagrant class Action module VM diff --git a/lib/vagrant/downloaders/file.rb b/lib/vagrant/downloaders/file.rb index 38ba7bf34..67bfccdca 100644 --- a/lib/vagrant/downloaders/file.rb +++ b/lib/vagrant/downloaders/file.rb @@ -1,3 +1,5 @@ +require 'fileutils' + module Vagrant module Downloaders # "Downloads" a file to a temporary file. Basically, this downloader diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 61f8fc043..96be3f008 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -1,3 +1,6 @@ +require 'pathname' +require 'fileutils' + module Vagrant # Represents a single Vagrant environment. This class is responsible # for loading all of the Vagrantfile's for the given environment and diff --git a/lib/vagrant/provisioners/chef_server.rb b/lib/vagrant/provisioners/chef_server.rb index b4677c0c6..13826950c 100644 --- a/lib/vagrant/provisioners/chef_server.rb +++ b/lib/vagrant/provisioners/chef_server.rb @@ -1,3 +1,5 @@ +require 'pathname' + module Vagrant module Provisioners # This class implements provisioning via chef-client, allowing provisioning diff --git a/lib/vagrant/ssh.rb b/lib/vagrant/ssh.rb index 00072500e..86daffd8a 100644 --- a/lib/vagrant/ssh.rb +++ b/lib/vagrant/ssh.rb @@ -1,3 +1,7 @@ +require 'net/ssh' +require 'net/scp' +require 'mario' + module Vagrant # Manages SSH access to a specific environment. Allows an environment to # replace the process with SSH itself, run a specific set of commands, diff --git a/lib/vagrant/util/plain_logger.rb b/lib/vagrant/util/plain_logger.rb index 262b0c56e..71927ee72 100644 --- a/lib/vagrant/util/plain_logger.rb +++ b/lib/vagrant/util/plain_logger.rb @@ -1,3 +1,5 @@ +require 'logger' + module Vagrant module Util # Subclass of the standard library logger which has no format on diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index 74f37134d..8be0e4fe6 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -1,3 +1,5 @@ +require 'mario' + module Vagrant module Util # This class just contains some platform checking code. diff --git a/lib/vagrant/util/resource_logger.rb b/lib/vagrant/util/resource_logger.rb index 43941d83a..ce9cf700b 100644 --- a/lib/vagrant/util/resource_logger.rb +++ b/lib/vagrant/util/resource_logger.rb @@ -1,4 +1,5 @@ require 'thread' +require 'mario' module Vagrant module Util