Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Unicorn wrapper that restarts the server when a file changes (inspired by http://namelessjon.posterous.com/?tag=unicorn)
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rvmrc
Gemfile
Gemfile.lock
README.md
unicorn-directory-watcher.gemspec

README.md

Unicorn Directory Watcher

Unicorn wrapper that restarts the server when a file changes (inspired by http://namelessjon.posterous.com/?tag=unicorn)

Installation

gem install unicorn-directory-watcher

Usage

#!/usr/bin/env ruby
require 'rubygems'
require 'unicorn_directory_watcher'

app_name = "my-app"
root_dir = File.expand_path("#{File.dirname(__FILE__)}/..")

UnicornDirectoryWatcher.call(
  app_name,
    root_dir,
    :pid_file => "#{root_dir}/tmp/pids/unicorn.pid",
    :watcher_globs => {
      root_dir => "{app,lib,services,vendor}/**/*.rb"
    }
) do
  system "unicorn -D -E development -c config/unicorn.rb config.ru"
end
Something went wrong with that request. Please try again.