Class: Veewee::Command::Parallels

Inherits:
GroupBase
  • Object
show all
Defined in:
lib/veewee/command/parallels.rb

Instance Attribute Summary

Attributes inherited from GroupBase

#env

Instance Method Summary collapse

Methods inherited from GroupBase

#initialize, register

Methods included from Helpers

#initialize_environment

Constructor Details

This class inherits a constructor from Veewee::Command::GroupBase

Instance Method Details

#build(box_name) ⇒ Object



12
13
14
15
16
# File 'lib/veewee/command/parallels.rb', line 12

def build(box_name)
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.providers["parallels"].get_box(box_name).build(options)
end

#define(definition_name, template_name) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/veewee/command/parallels.rb', line 56

def define(definition_name, template_name)
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.definitions.define(definition_name,template_name,options)
  env.ui.info "The basebox '#{definition_name}' has been succesfully created from the template '#{template_name}'"
  env.ui.info "You can now edit the definition files stored in definitions/#{definition_name} or build the box with:"
  env.ui.info "veewee parallels build '#{definition_name}'"
end

#destroy(box_name) ⇒ Object



21
22
23
24
25
# File 'lib/veewee/command/parallels.rb', line 21

def destroy(box_name)
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.providers["parallels"].get_box(box_name).destroy(options)
end

#halt(box_name) ⇒ Object



30
31
32
33
34
# File 'lib/veewee/command/parallels.rb', line 30

def halt(box_name)
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.providers["parallels"].get_box(box_name).halt(options)
end

#listObject



112
113
114
115
116
117
118
119
# File 'lib/veewee/command/parallels.rb', line 112

def list
  env.ui.info "The following local definitions are available:",:prefix => false
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.definitions.each do |name,definition|
    env.ui.info "- #{name}"
  end
end

#ostypesObject



91
92
93
94
95
96
97
# File 'lib/veewee/command/parallels.rb', line 91

def ostypes
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.ostypes.each do |name|
     env.ui.info "- #{name}"
  end
end

#ssh(box_name, command = nil) ⇒ Object



47
48
49
50
51
# File 'lib/veewee/command/parallels.rb', line 47

def ssh(box_name,command=nil)
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.providers["parallels"].get_box(box_name).issh(command)
end

#templatesObject



101
102
103
104
105
106
107
108
# File 'lib/veewee/command/parallels.rb', line 101

def templates
  env.ui.info "The following templates are available:",:prefix => false
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.templates.each do |name,template|
    env.ui.info "veewee parallels define '<box_name>' '#{name}'",:prefix => false
  end
end

#undefine(definition_name) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/veewee/command/parallels.rb', line 67

def undefine(definition_name)
  env.ui.info "Removing definition #{definition_name}" , :prefix => false
  begin
    venv=Veewee::Environment.new(options)
    venv.ui=env.ui
    venv.definitions.undefine(definition_name,options)
    env.ui.info "Definition #{definition_name} succesfully removed",:prefix => false
  rescue Error => ex
    env.ui.error "#{ex}" , :prefix => false
    exit -1
  end
end

#up(box_name) ⇒ Object



39
40
41
42
43
# File 'lib/veewee/command/parallels.rb', line 39

def up(box_name)
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.providers["parallels"].get_box(box_name).up(options)
end

#validate(box_name) ⇒ Object



83
84
85
86
87
# File 'lib/veewee/command/parallels.rb', line 83

def validate(box_name)
  venv=Veewee::Environment.new(options)
  venv.ui=env.ui
  venv.providers["parallels"].get_box(box_name).validate_parallels(options)
end