class Rubble::Context

Attributes

local_executor[R]
tool[R]
uuid[R]

Public Class Methods

new(tool) click to toggle source
# File lib/rubble/context.rb, line 11
def initialize(tool)
    @tool = tool
    uuid_str = SecureRandom.uuid.gsub(/-/, '')
    uuid_bytes = [uuid_str].pack('H*')
    @uuid = Base32.encode(uuid_bytes).gsub(/=+$/, '')
    @remote_executors = {}
    @local_executor = Executor::Local.new
end

Public Instance Methods

close() click to toggle source
# File lib/rubble/context.rb, line 26
def close
    @remote_executors.each_value do |executor|
        executor.close
    end
    @remote_executors = {}
end
remote_executor(server) click to toggle source
# File lib/rubble/context.rb, line 20
def remote_executor(server)
    @remote_executors.fetch(server.name) do |k|
        @remote_executors[server.name] = Executor::Remote.new(server, local_executor)
    end
end