guard-puppet/lib/guard/puppet/log.rb
2011-07-05 19:43:36 -04:00

25 lines
361 B
Ruby

module Puppet; end
require 'puppet/util'
require 'puppet/util/log'
::Puppet::Util::Log.newdesttype :guard do
attr_reader :messages
def initialize
close
end
def handle(msg)
@messages << msg
end
def close
@messages = []
end
def has_failed?
messages.find { |msg| (::Puppet::Util::Log.levels.index(msg.level)) >= 4 }
end
end