Class: Chef::Provider::File::Content

Inherits:
FileContentManagement::ContentBase show all
Defined in:
lib/chef/provider/file/content.rb

Instance Attribute Summary

Attributes inherited from FileContentManagement::ContentBase

#current_resource, #logger, #new_resource, #run_context

Instance Method Summary collapse

Methods inherited from FileContentManagement::ContentBase

#initialize, #tempfile

Constructor Details

This class inherits a constructor from Chef::FileContentManagement::ContentBase

Instance Method Details

#file_for_providerObject



26
27
28
29
30
31
32
33
34
35
# File 'lib/chef/provider/file/content.rb', line 26

def file_for_provider
  if @new_resource.content
    tempfile = Chef::FileContentManagement::Tempfile.new(@new_resource).tempfile
    tempfile.write(@new_resource.content)
    tempfile.close
    tempfile
  else
    nil
  end
end