Class: Elevage::New

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/elevage/new.rb

Overview

Create new platform definition files and environments folder structure

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/elevage/new.rb', line 10

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#already_exists?Boolean

Confirm command is not being run in folder with existing platform definition

Returns:

  • (Boolean)


16
17
18
# File 'lib/elevage/new.rb', line 16

def already_exists?
  File.file?(YML_PLATFORM) && fail(IOError, ERR[:platform_exists])
end

#create_infrastructure_filesObject

Create the infrastructure definition files



26
27
28
29
30
# File 'lib/elevage/new.rb', line 26

def create_infrastructure_files
  template(TEMPLATE_VCENTER, YML_VCENTER)
  template(TEMPLATE_NETWORK, YML_NETWORK)
  template(TEMPLATE_COMPUTE, YML_COMPUTE)
end

#create_platform_fileObject

Create the platform definition file



21
22
23
# File 'lib/elevage/new.rb', line 21

def create_platform_file
  template(TEMPLATE_PLATFORM, YML_PLATFORM)
end