guard-puppet/lib/guard/puppet/log.rb

25 lines
361 B
Ruby
Raw Normal View History

2011-07-05 23:43:36 +00:00
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