2010-08-24 04:41:40 +00:00
|
|
|
require 'json'
|
2010-08-27 04:56:38 +00:00
|
|
|
require 'i18n'
|
2010-08-24 04:41:40 +00:00
|
|
|
require 'virtualbox'
|
2010-09-02 02:46:11 +00:00
|
|
|
require 'radar'
|
2010-03-13 11:08:26 +00:00
|
|
|
|
2010-08-24 04:33:14 +00:00
|
|
|
module Vagrant
|
2010-08-24 17:27:36 +00:00
|
|
|
# TODO: Move more classes over to the autoload model. We'll
|
|
|
|
# start small, but slowly move everything over.
|
|
|
|
|
2010-09-02 05:00:59 +00:00
|
|
|
autoload :CLI, 'vagrant/cli'
|
|
|
|
autoload :Config, 'vagrant/config'
|
|
|
|
autoload :DataStore, 'vagrant/data_store'
|
|
|
|
autoload :Errors, 'vagrant/errors'
|
2010-09-03 16:33:15 +00:00
|
|
|
autoload :Util, 'vagrant/util'
|
2010-08-24 17:27:36 +00:00
|
|
|
|
|
|
|
module Command
|
2010-08-24 17:58:36 +00:00
|
|
|
autoload :Base, 'vagrant/command/base'
|
|
|
|
autoload :GroupBase, 'vagrant/command/group_base'
|
2010-08-25 00:49:22 +00:00
|
|
|
autoload :Helpers, 'vagrant/command/helpers'
|
2010-08-25 06:50:20 +00:00
|
|
|
autoload :NamedBase, 'vagrant/command/named_base'
|
2010-08-24 17:27:36 +00:00
|
|
|
end
|
|
|
|
|
2010-08-24 18:18:29 +00:00
|
|
|
# The source root is the path to the root directory of
|
|
|
|
# the Vagrant gem.
|
|
|
|
def self.source_root
|
|
|
|
@source_root ||= File.expand_path('../../', __FILE__)
|
2010-08-24 04:33:14 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-09-02 02:46:11 +00:00
|
|
|
# Setup Radar application for exception catching
|
|
|
|
Radar::Application.new(:vagrant) do |app|
|
|
|
|
app.reject :class, Vagrant::Errors::VagrantError
|
|
|
|
app.reject :class, SystemExit
|
|
|
|
app.reporters.use :file
|
|
|
|
app.rescue_at_exit!
|
|
|
|
end
|
|
|
|
|
2010-08-27 04:56:38 +00:00
|
|
|
# Default I18n to load the en locale
|
|
|
|
I18n.load_path << File.expand_path("templates/locales/en.yml", Vagrant.source_root)
|
|
|
|
|
2010-08-24 04:41:40 +00:00
|
|
|
# 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.
|
2010-08-24 04:33:14 +00:00
|
|
|
libdir = File.expand_path("lib/vagrant", Vagrant.source_root)
|
2010-09-03 16:33:15 +00:00
|
|
|
Vagrant::Util::GlobLoader.glob_require(libdir, %w{
|
2010-09-02 03:37:11 +00:00
|
|
|
downloaders/base provisioners/base provisioners/chef systems/base
|
2010-09-01 17:04:37 +00:00
|
|
|
hosts/base})
|
2010-07-04 02:58:03 +00:00
|
|
|
|
|
|
|
# Initialize the built-in actions
|
|
|
|
Vagrant::Action.builtin!
|