Sha256: 8905efe9fd27ba9a326b49d8df9b6f0222dd7de2716847d8f1790d5cb70b5f7c

Contents?: true

Size: 577 Bytes

Versions: 2

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true
require_relative './inventory'

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

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

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



Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wiz-teleport-0.5.1 lib/wiz-teleport/shell.rb
wiz-teleport-0.5.0 lib/wiz-teleport/shell.rb