[RUBY] Develop C programs with guard

Overview

advantage

Construction procedure

It is assumed that the ruby environment has been created

  1. Create a Gemfile
source 'https://rubygems.org'
gem 'guard'
gem 'guard-shell'

  1. Installation

bundle install

  1. Create Guardfile

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

Example

guard 'shell' do 
  watch(%r{^.+\.(h|c)$}) do 
    `make test` 
  end 
end
  1. Start Guard.

bundle exec guard

This will detect the changes in the file and run the build or test.

Reference material

http://stackoverflow.com/questions/9673629/using-ruby-guard-gem-to-monitor-c-files

Recommended Posts

Develop C programs with guard
Develop Arduino with vscode @Ubuntu
Hello World with Docker and C
Encrypt with Java and decrypt with C #
Develop Processing with IntelliJ + Kotlin + Gradle