/usr/lib/ruby/vendor_ruby/chef_compat/monkeypatches/chef.rb is in ruby-compat-resource 12.10.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | class Chef
NOT_PASSED = Object.new if !defined?(NOT_PASSED)
# Earlier versions of Chef didn't have this message
module ChefCompatDeprecation
def log_deprecation(message, location=nil)
if !location
# Pick the first caller that is *not* part of the Chef or ChefCompat gem,
# that's the thing the user wrote.
chef_compat_gem_path = File.expand_path("../../..", __FILE__)
chef_gem_path = File.expand_path("../..",::Chef::Resource.instance_method(:initialize).source_location[0])
caller(0..10).each do |c|
if !c.start_with?(chef_gem_path) && !c.start_with?(chef_compat_gem_path)
location = c
break
end
end
end
begin
super
# Bleagh. `super_method` doesn't exist on older rubies and I haven't
# figured out a way to check for its existence otherwise.
rescue NoMethodError
Chef::Log.warn(message)
end
end
end
class<<self
prepend ChefCompatDeprecation
end
end
|