Class: Guard::Chef

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/chef.rb

Instance Method Summary collapse

Constructor Details

#initialize(watchers = [], options = {}) ⇒ Chef

Returns a new instance of Chef.



9
10
11
12
13
# File 'lib/guard/chef.rb', line 9

def initialize(watchers=[], options={})
  super
  @base_dir = ::File.expand_path('../../../',  __FILE__)
  # init stuff here, thx!
end

Instance Method Details

#reloadObject

Called on Ctrl-Z signal This method should be mainly used for “reload” (really!) actions like reloading passenger/spork/bundler/…



35
36
37
# File 'lib/guard/chef.rb', line 35

def reload
  true
end

#run_allObject

Called on Ctrl-/ signal This method should be principally used for long action like running all specs/tests/…



41
42
43
# File 'lib/guard/chef.rb', line 41

def run_all
  true
end

#run_on_change(paths) ⇒ Object

Called on file(s) modifications



46
47
48
49
50
51
52
53
# File 'lib/guard/chef.rb', line 46

def run_on_change(paths)
  paths.each do |path|
    unless updated?(path)
      return false
    end
  end
  true
end

#startObject

Called once when Guard starts Please override initialize method to init stuff



24
25
26
# File 'lib/guard/chef.rb', line 24

def start
  true
end

#stopObject

Called on Ctrl-C signal (when Guard quits)



29
30
31
# File 'lib/guard/chef.rb', line 29

def stop
  true
end