class Chef::Resource::OhaiHint
Public Instance Methods
Source
# File lib/chef/resource/ohai_hint.rb, line 110 def format_content(content) return "" if content.nil? || content.empty? JSON.pretty_generate(content) end
format content hash as JSON @param content [Hash] the content of the hint file @return [JSON] json representation of the content of an empty string if content was nil
Source
# File lib/chef/resource/ohai_hint.rb, line 101 def ohai_hint_file_path(filename) path = ::File.join(::Ohai::Config.ohai.hints_path.first, filename) path << ".json" unless path.end_with?(".json") path end
given a hint filename return the platform specific hint file path @param filename [String] the name of the hint file @return [String] absolute path to the file