This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# init.d script for single or multiple unicorn installations. Expects at least one .conf | |
# file in /etc/unicorn | |
# | |
# Modified by jay@gooby.org http://github.com/jaygooby | |
# based on http://gist.github.com/308216 by http://github.com/mguterl | |
# | |
## A sample /etc/unicorn/my_app.conf | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Inline | |
include Haml::Filters::Base | |
def self.[](key) | |
@@data[key.to_s] rescue nil | |
end | |
def render(str) | |
@@data = Hash[*str.split(/^\s*@@\s*(\w+)\s*\n/m)[1..-1]] | |
return nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# vim: ft=ruby | |
def mk_uniq_name_by(filename, path) | |
uniq_name = filename | |
prefix = 0 | |
while FileTest.exist?(File.join(path, uniq_name)) | |
prefix += 1 | |
uniq_name = sprintf("%d.%s", prefix, filename) | |
end | |
uniq_name |