Class: HmxClient::Command::Partition

Inherits:
Base
  • Object
show all
Defined in:
lib/hmx/command/partition.rb

Overview

Create new partitions in HMX based on the current partition

Constant Summary

Constants inherited from Base

Base::FILE

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

#hmx, #initialize, #loadConfig!, namespace, #removeConfig, #storeConfig, #writeConfig

Methods included from Helpers

#display, #display_row, #display_tab, #display_table, #error, #getFromUser, #longest

Constructor Details

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

Instance Method Details

#createObject

partition:create

Create a new partition based on this partition



23
24
25
26
27
# File 'lib/hmx/command/partition.rb', line 23

def create
   target = args.shift;
   style = args.shift;
   partition = hmx.doClonePartition([target, style]);
end

#indexObject

partition

List the partitions on this system (requires administrative privileges)



13
14
15
16
17
18
# File 'lib/hmx/command/partition.rb', line 13

def index
   partitions = hmx.doGetPartitions([]);
   partitions.each do | p | 
         puts p['name'];
   end
end

#switchObject

partition:switch

Switch the context of this hmx configuration to a new partition This is basically a synonym of config:add partition=



33
34
35
36
# File 'lib/hmx/command/partition.rb', line 33

def switch
    storeConfig("partition".to_sym, args.shift);
    puts "Done"
end