class LegacyFacter::Util::Parser::JsonParser

Public Instance Methods

parse_results() click to toggle source
# File lib/facter/custom_facts/util/parser.rb, line 136
def parse_results
  if LegacyFacter.json?
    JSON.parse(content)
  else
    log.warnonce "Cannot parse JSON data file #{filename} without the json library."
    log.warnonce 'Suggested next step is `gem install json` to install the json library.'
    nil
  end
end

Private Instance Methods

log() click to toggle source
# File lib/facter/custom_facts/util/parser.rb, line 148
def log
  @log ||= Facter::Log.new(self)
end