Rakefile in veewee-0.0.2 vs Rakefile in veewee-0.1.0a
- old
+ new
@@ -1,19 +1,49 @@
require 'rubygems'
require 'bundler'
require 'bundler/setup'
Bundler::GemHelper.install_tasks
+#We set this in the ENV file
+#ENV['GEM_PATH']=File.join(File.dirname(__FILE__),"gems")
+#ENV['GEM_HOME']=File.join(File.dirname(__FILE__),"gems")
+
+def check_environment
+ begin
+ require 'vagrant'
+ rescue LoadError
+ puts "you need to install dependencies:"
+ puts "gem install vagrant"
+ exit
+ end
+
+ begin
+ require 'net/ssh'
+ require 'virtualbox'
+ require 'webrick'
+ require 'popen4'
+ rescue LoadError
+ puts "hmm you had vagrant installed but are missing the net-ssh or virtualbox gem"
+ puts "gem install virtualbox net-ssh POpen4"
+ exit
+ end
+end
+
+#See if all gems and so are installed
+check_environment
+
#Setup some base variables to use
-veewee_dir= "."
+veewee_dir= File.dirname(__FILE__)
definition_dir= File.expand_path(File.join(veewee_dir, "definitions"))
lib_dir= File.expand_path(File.join(veewee_dir, "lib"))
box_dir= File.expand_path(File.join(veewee_dir, "boxes"))
template_dir=File.expand_path(File.join(veewee_dir, "templates"))
vbox_dir=File.expand_path(File.join(veewee_dir, "tmp"))
tmp_dir=File.expand_path(File.join(veewee_dir, "tmp"))
iso_dir=File.expand_path(File.join(veewee_dir, "iso"))
+#needs to be moved to the config files to be allowed override
+ENV['VBOX_USER_HOME']=vbox_dir
#Load Veewee::Session libraries
Dir.glob(File.join(lib_dir, '**','*.rb')).each {|f|
require f }