It is assumed that the ruby environment has been created
source 'https://rubygems.org'
gem 'guard'
gem 'guard-shell'
bundle install
bundle exec guard init
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
# Add files and commands to this file, like the example:
# watch(%r{file/path}) { `command(s)` }
#
guard 'shell' do
watch(/(.*).txt/) {|m| `tail #{m[0]}` }
end
guard 'shell' do
watch(%r{^.+\.(h|c)$}) do
`make test`
end
end
bundle exec guard
This will detect the changes in the file and run the build or test.
http://stackoverflow.com/questions/9673629/using-ruby-guard-gem-to-monitor-c-files