Method: Chef::Compliance::ProfileCollection#from_file

Defined in:
lib/chef/compliance/profile_collection.rb

#from_file(path, cookbook_name) ⇒ Object

Add a profile to the profile collection. The cookbook_name needs to be determined by the caller and is used in the ‘include_profile` API to match on. The path should be the complete path on the host of the inspec.yml file, including the filename.

Parameters:



41
42
43
44
45
# File 'lib/chef/compliance/profile_collection.rb', line 41

def from_file(path, cookbook_name)
  new_profile = Profile.from_file(events, path, cookbook_name)
  self << new_profile
  events&.compliance_profile_loaded(new_profile)
end