class Chef::Provider::RemoteFile

Public Class Methods

new(new_resource, run_context) click to toggle source
Calls superclass method Chef::Provider::File::new
# File lib/chef/provider/remote_file.rb, line 27
def initialize(new_resource, run_context)
  @content_class = Chef::Provider::RemoteFile::Content
  super
end

Public Instance Methods

define_resource_requirements() click to toggle source
# File lib/chef/provider/remote_file.rb, line 32
def define_resource_requirements
  [ new_resource.remote_user, new_resource.remote_domain,
    new_resource.remote_password ].each do |prop|
      requirements.assert(:all_actions) do |a|
        a.assertion do
          if prop
            windows?
          else
            true
          end
        end
        a.failure_message Chef::Exceptions::UnsupportedPlatform, "'remote_user', 'remote_domain' and 'remote_password' properties are supported only for Windows platform"
        a.whyrun("Assuming that the platform is Windows while passing 'remote_user', 'remote_domain' and 'remote_password' properties")
      end
    end

  super
end
load_current_resource() click to toggle source
# File lib/chef/provider/remote_file.rb, line 51
def load_current_resource
  @current_resource = Chef::Resource::RemoteFile.new(new_resource.name)
  super
end

Private Instance Methods

managing_content?() click to toggle source
# File lib/chef/provider/remote_file.rb, line 58
def managing_content?
  return true if new_resource.checksum
  return true if !new_resource.source.nil? && @action != :create_if_missing

  false
end