Class: TyrantManager::Commands::CreateInstance

Inherits:
TyrantManager::Command show all
Defined in:
lib/tyrant_manager/commands/create_instance.rb

Overview

Create a new Tyrant instance

Instance Attribute Summary

Attributes inherited from TyrantManager::Command

#manager, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TyrantManager::Command

#after, #before, #command_name, #error, find, inherited, #initialize, list, #logger

Constructor Details

This class inherits a constructor from TyrantManager::Command

Class Method Details

.command_nameObject



14
15
16
# File 'lib/tyrant_manager/commands/create_instance.rb', line 14

def self.command_name
'create-instance'
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tyrant_manager/commands/create_instance.rb', line 18

def run
  path = Pathname.new( options['instance-home'] )
  unless path.absolute? then
    path = Pathname.new( manager.instances_path ) + path
  end

  unless path.exist? then
    logger.info "Creating instance directory #{path}"
    TyrantManager::TyrantInstance.setup( path.to_s )
  end
  tt = TyrantManager::TyrantInstance.new( path.to_s )
end