Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib v0.1.5 July 17, 2011
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 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.