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



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

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



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

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 successfully 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



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

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



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

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

#listObject



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

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



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

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



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

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



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

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



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

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} successfully removed",:prefix => false
  rescue Error => ex
    env.ui.error "#{ex}" , :prefix => false
    exit -1
  end
end

#up(box_name) ⇒ Object



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

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



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

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