0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
guard-restarter is a guard plugin to run a command (often a server) and restart it when files change.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

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