Class: Chef::Resource::ChefGem

Inherits:
Package::GemPackage
  • Object
show all
Defined in:
lib/chef/resource/chef_gem.rb

Instance Method Summary collapse

Instance Method Details

#after_createdObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/chef/resource/chef_gem.rb', line 33

def after_created
  # Chef::Resource.run_action: Caveat: this skips Chef::Runner.run_action, where notifications are handled
  # Action could be an array of symbols, but probably won't (think install + enable for a package)
  if compile_time.nil?
    Chef.log_deprecation "#{self} chef_gem compile_time installation is deprecated"
    Chef.log_deprecation "#{self} Please set `compile_time false` on the resource to use the new behavior."
    Chef.log_deprecation "#{self} or set `compile_time true` on the resource if compile_time behavior is required."
  end

  if compile_time || compile_time.nil?
    Array(action).each do |action|
      self.run_action(action)
    end
    Gem.clear_paths
  end
end