Repository is archived
No commit activity in last 3 years
No release in over 3 years
Unicorn wrapper that restarts the server when a file changes (inspired by http://namelessjon.posterous.com/?tag=unicorn)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2.6

Runtime

>= 0.3.2
 Project Readme

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