Skip to content
This repository was archived by the owner on Sep 18, 2019. It is now read-only.

cespare/guard-restarter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: I neither use nor maintain this project anymore.

See https://github.com/cespare/reflex

Guard::Restarter

This is a small guard plugin to run a command (typically a server) and restart it when files change. It restarts the process by killing it (with SIGINT, followed by SIGKILL if it doesn't die after a bit). It takes care of ensuring the process (and any children) are gone before bringing it up again.

Installation

$ gem install guard-restarter

or add it to your gemfile:

gem "guard-restarter"

Usage

Pretty straightforward:

guard :restarter, :command => "./run_server" do
  watch(/\.*\.[ch]$/)
end

You can also pass in the full set of arguments to Process.spawn for more control:

guard :restarter, :spawn => [{ "CC" => "gcc" }, "make", :err => "/dev/null"] do
  watch(/\.*\.[ch]$/)
end

About

A Guard plugin to start something (like a server) and restart it when files change.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages