Class: Guard::Puppet

Inherits:
Plugin
  • Object
show all
Defined in:
lib/guard/puppet.rb,
lib/guard/puppet/runner.rb

Defined Under Namespace

Classes: Runner

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Puppet

Returns a new instance of Puppet.



9
10
11
12
13
14
15
# File 'lib/guard/puppet.rb', line 9

def initialize(options = {})
  super
  @options = options

  UI.info "Guard::Puppet is watching for changes..."
  run_all if options[:run_on_start]
end

Class Attribute Details

.is_wrapping_exitObject

Returns the value of attribute is_wrapping_exit.



6
7
8
# File 'lib/guard/puppet.rb', line 6

def is_wrapping_exit
  @is_wrapping_exit
end

Instance Method Details

#run_allObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/guard/puppet.rb', line 17

def run_all
  UI.info(msg = "Applying Puppet configuration...")
  Notifier.notify msg, :title => "Puppet Config", :image => :pending
  if Runner.new(@options).run != 0
    Notifier.notify(msg = "Puppet config failure!", :title => "Puppet Config", :image => :failed)
  else
    Notifier.notify(msg = "Puppet config reapplied successfully!", :title => "Puppet Config")
  end
  UI.info(msg)
end

#run_on_change(files = []) ⇒ Object



28
29
30
# File 'lib/guard/puppet.rb', line 28

def run_on_change(files = [])
  run_all
end