Class: WizTeleport::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/wiz-teleport/shell.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path = 'inventory.yml') ⇒ Shell

Returns a new instance of Shell.



6
7
8
9
# File 'lib/wiz-teleport/shell.rb', line 6

def initialize(file_path = 'inventory.yml')
  @inventory = WizTeleport::Inventory.instance
  @inventory.from_yaml(file_path)
end

Class Method Details

.run(group_name, &block) ⇒ Object



18
19
20
21
# File 'lib/wiz-teleport/shell.rb', line 18

def self.run(group_name, &block)
  shell = WizTeleport::Shell.new
  shell.run(group_name, &block)
end

Instance Method Details

#run(group_name, &block) ⇒ Object



11
12
13
14
15
16
# File 'lib/wiz-teleport/shell.rb', line 11

def run(group_name, &block)
  @clients = @inventory.clients_from_group(group_name)
  @clients.each do |client|
    client.instance_eval(&block)
  end
end