class Chef::Provider::Template
Public Class Methods
Source
# File lib/chef/provider/template.rb, line 28 def initialize(new_resource, run_context) @content_class = Chef::Provider::Template::Content super end
Calls superclass method
Chef::Provider::File::new
Public Instance Methods
Source
# File lib/chef/provider/template.rb, line 38 def define_resource_requirements super requirements.assert(:create, :create_if_missing) do |a| a.assertion { ::File.exist?(content.template_location) } a.failure_message "Template source #{content.template_location} could not be found." a.whyrun "Template source #{content.template_location} does not exist. Assuming it would have been created." a.block_action! end end
Calls superclass method
Chef::Provider::File#define_resource_requirements
Source
# File lib/chef/provider/template.rb, line 33 def load_current_resource @current_resource = Chef::Resource::Template.new(new_resource.name) super end
Calls superclass method
Chef::Provider::File#load_current_resource
Private Instance Methods
Source
# File lib/chef/provider/template.rb, line 51 def managing_content? return true if new_resource.checksum return true if !new_resource.source.nil? && @action != :create_if_missing false end