vagrant/lib/vagrant.rb

47 lines
1.5 KiB
Ruby
Raw Normal View History

require 'pathname'
require 'json'
require 'i18n'
require 'virtualbox'
2010-08-24 04:33:14 +00:00
module Vagrant
# TODO: Move more classes over to the autoload model. We'll
# start small, but slowly move everything over.
autoload :Box, 'vagrant/box'
autoload :BoxCollection, 'vagrant/box_collection'
autoload :CLI, 'vagrant/cli'
autoload :Config, 'vagrant/config'
autoload :DataStore, 'vagrant/data_store'
autoload :Errors, 'vagrant/errors'
2010-09-15 05:10:51 +00:00
autoload :Plugin, 'vagrant/plugin'
2010-09-15 15:19:38 +00:00
autoload :TestHelpers, 'vagrant/test_helpers'
autoload :Util, 'vagrant/util'
module Command
autoload :Base, 'vagrant/command/base'
autoload :GroupBase, 'vagrant/command/group_base'
autoload :Helpers, 'vagrant/command/helpers'
autoload :NamedBase, 'vagrant/command/named_base'
end
# The source root is the path to the root directory of
# the Vagrant gem.
def self.source_root
@source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
2010-08-24 04:33:14 +00:00
end
end
# Default I18n to load the en locale
I18n.load_path << File.expand_path("templates/locales/en.yml", Vagrant.source_root)
# 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)
Vagrant::Util::GlobLoader.glob_require(libdir, %w{
downloaders/base provisioners/base provisioners/chef systems/base
hosts/base})
2010-09-15 05:10:51 +00:00
# Initialize the built-in actions and load the plugins.
Vagrant::Action.builtin!
2010-09-15 05:10:51 +00:00
Vagrant::Plugin.load!