Included Modules

Class/Module Index [+]

Quicksearch

Chef::Resource::RemoteFile

Public Class Methods

new(name, run_context=nil) click to toggle source
# File lib/chef/resource/remote_file.rb, line 31
def initialize(name, run_context=nil)
  super
  @resource_name = :remote_file
  @action = "create"
  @source = ::File.basename(name)
  @cookbook = nil
  @provider = Chef::Provider::RemoteFile
end

Public Instance Methods

checksum(args=nil) click to toggle source
# File lib/chef/resource/remote_file.rb, line 56
def checksum(args=nil)
  set_or_return(
    :checksum,
    args,
    :kind_of => String
  )
end
cookbook(args=nil) click to toggle source
# File lib/chef/resource/remote_file.rb, line 48
def cookbook(args=nil)
  set_or_return(
    :cookbook,
    args,
    :kind_of => String
  )
end
provider() click to toggle source

The provider that should be used for this resource.

Returns:

Chef::Provider::RemoteFile when the source is an absolute URI, like

http://www.google.com/robots.txt

Chef::Provider::CookbookFile when the source is a relative URI, like

'myscript.pl', 'dir/config.conf'
# File lib/chef/resource/remote_file.rb, line 70
def provider
  if absolute_uri?(source)
    Chef::Provider::RemoteFile
  else
    Chef::Log.warn("remote_file is deprecated for fetching files from cookbooks. Use cookbook_file instead")
    Chef::Log.warn("From #{self.to_s} on #{source_line}")
    Chef::Provider::CookbookFile
  end
end
source(args=nil) click to toggle source
# File lib/chef/resource/remote_file.rb, line 40
def source(args=nil)
  set_or_return(
    :source,
    args,
    :kind_of => String
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.