]> git.openstreetmap.org Git - rails.git/blob - vendor/generators/daemon/templates/script_ctl
Seems that the Rails.env doesn't consistently work. Removing condition in config...
[rails.git] / vendor / generators / daemon / templates / script_ctl
1 #!/usr/bin/env ruby
2 require 'rubygems'
3 require "daemons"
4 require 'yaml'
5 require 'erb'
6
7 class Hash
8   def with_symbols!
9     self.keys.each{|key| self[key.to_s.to_sym] = self[key] }; self
10   end
11 end
12
13 options = YAML.load(
14   ERB.new(
15   IO.read(
16   File.dirname(__FILE__) + "/../../config/daemons.yml"
17   )).result).with_symbols!
18 options[:dir_mode] = options[:dir_mode].to_sym
19
20 Daemons.run File.dirname(__FILE__) + '/<%=file_name%>.rb', options