Files

Class/Module Index [+]

Quicksearch

Chef::Provider::Package::Windows

Public Instance Methods

install_package(name, version) click to toggle source

Chef::Provider::Package action_install + action_remove call install_package + remove_package Pass those calls to the correct sub-provider

# File lib/chef/provider/package/windows.rb, line 73
def install_package(name, version)
  package_provider.install_package(name, version)
end
installer_type() click to toggle source
# File lib/chef/provider/package/windows.rb, line 55
def installer_type
  @installer_type ||= begin
    if @new_resource.installer_type
      @new_resource.installer_type
    else
      file_extension = ::File.basename(@new_resource.source).split(".").last.downcase

      if file_extension == "msi"
        :msi
      else
        raise ArgumentError, "Installer type for Windows Package '#{@new_resource.name}' not specified and cannot be determined from file extension '#{file_extension}'"
      end
    end
  end
end
load_current_resource() click to toggle source

load_current_resource is run in Chef::Provider#run_action when not in whyrun_mode?

# File lib/chef/provider/package/windows.rb, line 35
def load_current_resource
  @new_resource.source(Chef::Util::PathHelper.validate_path(@new_resource.source))

  @current_resource = Chef::Resource::WindowsPackage.new(@new_resource.name)
  @current_resource.version(package_provider.installed_version)
  @new_resource.version(package_provider.package_version)
  @current_resource
end
package_provider() click to toggle source
# File lib/chef/provider/package/windows.rb, line 44
def package_provider
  @package_provider ||= begin
    case installer_type
    when :msi
      Chef::Provider::Package::Windows::MSI.new(@new_resource)
    else
      raise "Unable to find a Chef::Provider::Package::Windows provider for installer_type '#{installer_type}'"
    end
  end
end
remove_package(name, version) click to toggle source
# File lib/chef/provider/package/windows.rb, line 77
def remove_package(name, version)
  package_provider.remove_package(name, version)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.