2010-08-24 04:41:40 +00:00
|
|
|
require 'json'
|
|
|
|
require 'virtualbox'
|
|
|
|
require "vagrant/util/glob_loader"
|
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.
|
|
|
|
|
|
|
|
autoload :CLI, 'vagrant/cli'
|
|
|
|
|
|
|
|
module Command
|
|
|
|
autoload :Base, 'vagrant/command/base'
|
|
|
|
end
|
|
|
|
|
2010-08-24 04:33:14 +00:00
|
|
|
class << self
|
|
|
|
# The source root is the path to the root directory of
|
|
|
|
# the Vagrant gem.
|
|
|
|
def source_root
|
2010-08-24 04:44:53 +00:00
|
|
|
@source_root ||= File.expand_path('../../', __FILE__)
|
2010-08-24 04:33:14 +00:00
|
|
|
end
|
|
|
|
end
|
2010-08-24 06:44:42 +00:00
|
|
|
|
|
|
|
class VagrantError < StandardError
|
|
|
|
def self.status_code(code = nil)
|
|
|
|
define_method(:status_code) { code }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class CLIMissingEnvironment < VagrantError; status_code(1); end
|
2010-08-24 04:33:14 +00:00
|
|
|
end
|
|
|
|
|
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-08-24 17:27:36 +00:00
|
|
|
Vagrant::GlobLoader.glob_require(libdir, %w{util util/stacked_proc_runner
|
2010-07-09 04:52:56 +00:00
|
|
|
downloaders/base config provisioners/base provisioners/chef systems/base
|
2010-08-24 16:19:16 +00:00
|
|
|
action/exception_catcher hosts/base})
|
2010-07-04 02:58:03 +00:00
|
|
|
|
|
|
|
# Initialize the built-in actions
|
|
|
|
Vagrant::Action.builtin!
|