<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,7 +3,15 @@ require 'rubygems'
 require &quot;daemons&quot;
 require 'yaml'
 require 'erb'
+
+if(File.exists?(file_name))
+  require file_name
+else
+rails_version = File.new(File.dirname(__FILE__)+ &quot;/../../config/environment.rb&quot;).read.scan(/^ *RAILS_GEM_VERSION.*=.*['|&quot;](.*)['|&quot;]/)[0].to_s
+
+gem 'activesupport', rails_version
 require 'active_support'
+end
 
 options = YAML.load(
   ERB.new(
@@ -12,4 +20,4 @@ options = YAML.load(
   )).result).with_indifferent_access
 options[:dir_mode] = options[:dir_mode].to_sym
 
-Daemons.run File.dirname(__FILE__) + '/&lt;%=file_name%&gt;.rb', options
\ No newline at end of file
+Daemons.run File.dirname(__FILE__) + '/&lt;%=file_name%&gt;.rb', options</diff>
      <filename>generators/daemon/templates/script_ctl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8a3937f142eaceb293b3ca4be9abf97a273fd3f4</id>
    </parent>
  </parents>
  <author>
    <name>Joshua Moore</name>
    <email>josh@joshua-laptop.(none)</email>
  </author>
  <url>http://github.com/dougal/daemon_generator/commit/3b20cbdc21f90fb44f7670e37700bc4d5409b922</url>
  <id>3b20cbdc21f90fb44f7670e37700bc4d5409b922</id>
  <committed-date>2008-12-30T06:19:21-08:00</committed-date>
  <authored-date>2008-12-30T05:43:44-08:00</authored-date>
  <message>Added logic so that it loads the correct version of activesupport.  Previeusly if the rails app was not using the latest version of rails that was installed the deamon would not be able to load activesupport and would die.  I have added checks so that it first checks to see if rails is frozen.  If so it will use the frozen version.  If it is not frozen then it will load the version of activesupport that is spesified in config/environment.rb

Signed-off-by: Douglas F Shearer &lt;dougal.s@gmail.com&gt;</message>
  <tree>50c74103f625e83d0f7a322a940547d0dd336899</tree>
  <committer>
    <name>Douglas F Shearer</name>
    <email>dougal.s@gmail.com</email>
  </committer>
</commit>
