Sha256: 778f13d3fd6f162f389185544d887b7ecc8b48cfe5d1b57bbe4a00c4d1f5c6db

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

module PSWindows::Pkg
  include Beaker::CommandFactory

  def check_for_command(name)
    result = exec(Beaker::Command.new("where #{name}"), :acceptable_exit_codes => (0...127))
    result.exit_code == 0
  end

  def check_for_package(name)
    #HACK NOOP
    #raise "Cannot check for package #{name} on #{self}"
    0
  end

  def install_package(name, cmdline_args = '')
    #HACK NOOP
    #raise "Package #{name} cannot be installed on #{self}"
    0
  end

  def uninstall_package(name, cmdline_args = '')
    #HACK NOOP
    #raise "Package #{name} cannot be uninstalled on #{self}"
    0
  end

  private

  # @api private
  def identify_windows_architecture
    arch = nil
    execute("wmic os get osarchitecture",
    :acceptable_exit_codes => (0...127)) do |result|

      arch = if result.exit_code == 0
        result.stdout =~ /64/ ? '64' : '32'
      else
        identify_windows_architecture_from_os_name_for_win2003
      end
    end
    arch
  end

  # @api private
  def identify_windows_architecture_from_os_name_for_win2003
    arch = nil
    execute("wmic os get name",
    :acceptable_exit_codes => (0...127)) do |result|
      arch = result.stdout =~ /64/ ? '64' : '32'
    end
    arch
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
beaker-2.10.0 lib/beaker/host/pswindows/pkg.rb
beaker-2.9.0 lib/beaker/host/pswindows/pkg.rb
beaker-2.8.0 lib/beaker/host/pswindows/pkg.rb
beaker-2.7.1 lib/beaker/host/pswindows/pkg.rb
beaker-2.7.0 lib/beaker/host/pswindows/pkg.rb
beaker-2.6.0 lib/beaker/host/pswindows/pkg.rb
beaker-2.5.1 lib/beaker/host/pswindows/pkg.rb