Module: Chef::Deprecation::Provider::CookbookFile

Included in:
Provider::CookbookFile
Defined in:
lib/chef/deprecation/provider/cookbook_file.rb

Overview

Deprecation::Provider::CookbookFile

This module contains the deprecated functions of Chef::Provider::CookbookFile. These functions are refactored to different components. They are frozen and will be removed in Chef 13.

Instance Method Summary collapse

Instance Method Details

#backup_new_resourceObject



45
46
47
48
49
# File 'lib/chef/deprecation/provider/cookbook_file.rb', line 45

def backup_new_resource
  if ::File.exists?(@new_resource.path)
    backup @new_resource.path
  end
end

#content_stale?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/chef/deprecation/provider/cookbook_file.rb', line 41

def content_stale?
  ( ! ::File.exist?(@new_resource.path)) || ( ! compare_content)
end

#file_cache_locationObject



30
31
32
33
34
35
# File 'lib/chef/deprecation/provider/cookbook_file.rb', line 30

def file_cache_location
  @file_cache_location ||= begin
    cookbook = run_context.cookbook_collection[resource_cookbook]
    cookbook.preferred_filename_on_disk_location(node, :files, @new_resource.source, @new_resource.path)
  end
end

#resource_cookbookObject



37
38
39
# File 'lib/chef/deprecation/provider/cookbook_file.rb', line 37

def resource_cookbook
  @new_resource.cookbook || @new_resource.cookbook_name
end