0.0
No commit activity in last 3 years
No release in over 3 years
Guard::Addremove automatically runs shell commands when watched files are added or removed from the file system.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.2.0
 Project Readme

Guard::Addremove

This guard allows you execute shell commands whenever files are added or removed. It is very much like guard-shell, but ignores changes to existing files.

Install

Make sure you have guard installed.

Install the gem with:

gem install guard-addremove

Or add it to your Gemfile:

gem 'guard-addremove'

And then add a basic setup to your Guardfile:

guard init addremove

Usage

This guard was originally written to allow the removal of caches when the filesystem changes. This can be helpful in combination with vim's plugins CtrlP or Command-T. Find a quick guide how to use it in my blog.

guard :addremove do
  watch /.*/ do |m|
    `echo "#{m[0]} has been added or removed."`
  end
end

will simply print a message telling you a file has been added or removed.