Sha256: 65f158132700f06dcf62d68fc162757c592e05ee02f515cc94afa932ec70ba63
Contents?: true
Size: 593 Bytes
Versions: 88
Compression:
Stored size: 593 Bytes
Contents
# Methods to help with handling warnings. module Puppet::Util::Warnings module_function def notice_once(msg) Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.notice msg } end def warnonce(msg) Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.warning msg } end def clear_warnings @stampwarnings = {} nil end protected def self.maybe_log(message, klass) @stampwarnings ||= {} @stampwarnings[klass] ||= [] return nil if @stampwarnings[klass].include? message yield @stampwarnings[klass] << message nil end end
Version data entries
88 entries across 88 versions & 4 rubygems