[RUBY] Entwickeln Sie C-Programme mit Guard

Überblick

Vorteil

Bauverfahren

Es wird davon ausgegangen, dass die Ruby-Umgebung bereits erstellt wurde.

  1. Erstellen Sie eine Gemfile
source 'https://rubygems.org'
gem 'guard'
gem 'guard-shell'

  1. Installation

bundle install

  1. Erstellen Sie eine 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

Beispiel

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

bundle exec guard

Dadurch werden die Änderungen in der Datei erkannt und der Build oder Test ausgeführt.

Referenzmaterial

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

Recommended Posts

Entwickeln Sie C-Programme mit Guard
Hallo Welt mit Docker und C Sprache
Mit Java verschlüsseln und mit C # entschlüsseln
Entwickeln Sie die Verarbeitung mit IntelliJ + Kotlin + Gradle