Sha256: 074cedba9de21330563016b2c32dd8fe376ec78ef6acb3216d8c224c9ba5569d
Contents?: true
Size: 386 Bytes
Versions: 11
Compression:
Stored size: 386 Bytes
Contents
# frozen_string_literal: true module Facter class YamlFactFormatter def initialize @log = Log.new(self) end def format(fact_hash) yaml_pretty = YAML.dump(JSON.parse(JsonFactFormatter.new.format(fact_hash))) @log.debug('Replace --- from yaml beginning, to keep it compatible with C facter') yaml_pretty.gsub(/^---[\r\n]+/, '') end end end
Version data entries
11 entries across 11 versions & 1 rubygems