Skip to content

Instantly share code, notes, and snippets.

@gaffneyc
Created April 13, 2011 17:16
Show Gist options
  • Save gaffneyc/917933 to your computer and use it in GitHub Desktop.
Save gaffneyc/917933 to your computer and use it in GitHub Desktop.
# run with
# watchr .watchr
watch('^roles/.*\.rb') { |m| role(m[0]) }
watch('^cookbooks/(.+?)/.*') { |m| cookbook(m[1]) }
watch('^d.*bags/(.+?)/.*') { |m| dbags(m[1], m[0]) }
def role(file)
system "knife role from file #{file}"
end
def cookbook(book)
if File.directory?("cookbooks/#{book}")
system "knife cookbook test #{book}"
end
end
def dbags(bag, file)
system "knife data bag from file #{bag} #{file}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment