Sha256: 4e235aff941ff84039699bf8d6af282fdc13f25c25e523361d5ddbb9ff162439

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

%w[host command_factory].each do |lib|
  require "beaker/#{lib}"
end

module Eos
  class Host < Unix::Host
    # Copies a remote file to the host location specified
    #
    # @param [String] remote_url URL to the remote file
    # @param [String] host_directory Path to the host directory on the host.
    #
    # @note in EOS, you just copy the file as an extension, you don't worry
    #   about location, so that parameter is ignored
    #
    # @return [Result] The result of copying that file to the host
    def get_remote_file(remote_url, _host_directory = '')
      commands = ['enable', "copy #{remote_url} extension:"]
      command = commands.join("\n")
      execute("Cli -c '#{command}'")
    end

    # Installs an extension file already copied via {#get_remote_file} or something similar
    #
    # @param [String] filename Name of the file to install, including file extension
    #
    # @return [Result] The result of running the install command on the host
    def install_from_file(filename)
      commands = ['enable', "extension #{filename}"]
      command = commands.join("\n")
      execute("Cli -c '#{command}'")
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
beaker-5.8.1 lib/beaker/host/eos.rb
beaker-5.8.0 lib/beaker/host/eos.rb
beaker-5.7.0 lib/beaker/host/eos.rb
beaker-5.6.0 lib/beaker/host/eos.rb
beaker-5.5.0 lib/beaker/host/eos.rb
beaker-5.4.0 lib/beaker/host/eos.rb
beaker-5.3.1 lib/beaker/host/eos.rb
beaker-5.3.0 lib/beaker/host/eos.rb
beaker-5.2.0 lib/beaker/host/eos.rb
beaker-5.1.0 lib/beaker/host/eos.rb
beaker-5.0.0 lib/beaker/host/eos.rb