guard-puppet/lib/guard/puppet.rb

31 lines
726 B
Ruby
Raw Normal View History

2011-07-01 02:48:18 +00:00
require 'guard/guard'
module ::Guard
class Puppet < ::Guard::Guard
class << self
attr_accessor :is_wrapping_exit
end
def initialize(watchers = [], options = {})
super
@options = options
end
def run_all
2011-07-01 03:53:15 +00:00
UI.info(msg = "Applying Puppet configuration...")
2011-07-01 02:48:18 +00:00
Notifier.notify msg, :title => "Puppet Config", :image => :pending
if Runner.new(@options).run != 0
Notifier.notify "Puppet config failure!", :title => "Puppet Config", :image => :failed
else
Notifier.notify "Puppet config reapplied successfully!", :title => "Puppet Config"
end
end
def run_on_change(files = [])
run_all
end
end
end
require 'guard/puppet/runner'