Class: Mccloud::Command::UnDefineCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/mccloud/command/undefine.rb

Instance Attribute Summary

Attributes inherited from Base

#env

Instance Method Summary collapse

Methods inherited from Base

#initialize, register

Methods included from Helpers

#initialize_environment

Constructor Details

This class inherits a constructor from Mccloud::Command::Base

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/mccloud/command/undefine.rb', line 9

def execute
  env.ui.info "Undefine machine #{name}"
  filename=File.join("vms","#{name}.rb")
  if File.exists?(filename)
    env.ui.info "Removing #{filename}"
    FileUtils.rm(filename)
  else
    env.ui.info "Machine #{name} has not yet defined"
  end
end