Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

trying to get the vagrant plugin to work

  • Loading branch information...
commit 2f5bc898118e1cac9c4117bd83b1af4f41dfb8ac 1 parent d96eac9
@jedi4ever authored
Showing with 76 additions and 0 deletions.
  1. +66 −0 lib/veewee/command2.rb
  2. +10 −0 lib/veewee/middleware.rb
View
66 lib/veewee/command2.rb
@@ -0,0 +1,66 @@
+require 'veewee/session'
+
+#Load Veewee::Session libraries
+lib_dir= File.expand_path(File.join(File.dirname(__FILE__),"..","..", "lib"))
+Dir.glob(File.join(lib_dir, '**','*.rb')).each {|f| require f }
+
+#Setup some base variables to use
+template_dir=File.expand_path(File.join(lib_dir,"..", "templates"))
+
+veewee_dir="."
+definition_dir= File.expand_path(File.join(veewee_dir, "definitions"))
+tmp_dir=File.expand_path(File.join(veewee_dir, "tmp"))
+iso_dir=File.expand_path(File.join(veewee_dir, "iso"))
+box_dir=File.expand_path(File.join(veewee_dir, "boxes"))
+
+#Initialize
+Veewee::Session.setenv({:veewee_dir => veewee_dir, :definition_dir => definition_dir,
+ :template_dir => template_dir, :iso_dir => iso_dir, :box_dir => box_dir, :tmp_dir => tmp_dir})
+
+puts "we get here"
+
+class Command22 < Vagrant::Command::GroupBase
+ register "basebox","Commands to manage baseboxes"
+
+ desc "templates", "List the currently available box templates"
+ def templates
+ Veewee::Session.list_templates
+ end
+
+ desc "define BOXNAME TEMPLATE", "Define a new box starting from a template"
+ def define(boxname, template)
+ puts "define a new box #{boxname}, starting from template #{template}"
+ Veewee::Session.define(boxname,template)
+ end
+
+ desc "build BOXNAME", "Build the box BOXNAME"
+ def build(boxname)
+ puts "Building box #{boxname}"
+ Veewee::Session.build(boxname)
+ end
+
+ desc "ostypes", "List the available Operating System types"
+ def ostypes
+ puts "Operating System types:"
+ Veewee::Session.list_ostypes
+ end
+
+ desc "clean", "Clean all unfinished builds"
+ def clean
+ puts "Cleaning all unfinished builds"
+ end
+
+end
+
+
+class SayHelloCommand < Vagrant::Command::Base
+ register "hello", "Says hello then goodbye"
+
+ def hello
+ puts "HELLO!"
+ end
+
+ def goodbye
+ puts "GOODBYE!"
+ end
+end
View
10 lib/veewee/middleware.rb
@@ -0,0 +1,10 @@
+class BaseBoxMiddleware
+ def initialize(app, env)
+ @app = app
+ end
+
+ def call(env)
+ env["ui"].info "Hello!"
+ @app.call(env)
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.