Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Guard plugin to start something (like a server) and restart it when files change.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/guard
.gitignore
Gemfile
LICENSE.txt
README.md
guard-restarter.gemspec

README.md

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
Something went wrong with that request. Please try again.