<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,12 +1,21 @@
 # Don't change this file!
 # Configure your app in config/environment.rb and config/environments/*.rb
 
-RAILS_ROOT = File.expand_path(&quot;#{File.dirname(__FILE__)}/..&quot;) unless defined?(RAILS_ROOT)
+RAILS_ROOT = &quot;#{File.dirname(__FILE__)}/..&quot; unless defined?(RAILS_ROOT)
+
+module Rails
+  class &lt;&lt; self
+    def vendor_rails?
+      File.exist?(&quot;#{RAILS_ROOT}/vendor/rails&quot;)
+    end
+  end
+end
 
 module Radiant
   class &lt;&lt; self
     def boot!
       unless booted?
+        preinitialize
         pick_boot.run
       end
     end
@@ -33,16 +42,23 @@ module Radiant
     def app?
       File.exist?(&quot;#{RAILS_ROOT}/lib/radiant.rb&quot;)
     end
+
+    def preinitialize
+      load(preinitializer_path) if File.exist?(preinitializer_path)
+    end
     
     def loaded_via_gem?
       pick_boot.is_a? GemBoot
     end
+
+    def preinitializer_path
+      &quot;#{RAILS_ROOT}/config/preinitializer.rb&quot;
+    end
   end
 
   class Boot
     def run
       load_initializer
-      Radiant::Initializer.run(:set_load_path)
     end
     
     def load_initializer
@@ -53,6 +69,7 @@ module Radiant
         $stderr.puts %(Radiant could not be initialized. #{load_error_message})
         exit 1
       end
+      Radiant::Initializer.run(:set_load_path)
     end
   end
 
@@ -60,8 +77,10 @@ module Radiant
     def load_initializer
       $LOAD_PATH.unshift &quot;#{RAILS_ROOT}/vendor/radiant/lib&quot; 
       super
+      #require &quot;#{RAILS_ROOT}/vendor/rails/railties/lib/initializer&quot;
+      #Rails::Initializer.run(:install_gem_spec_stubs)
     end
-    
+        
     def load_error_message
       &quot;Please verify that vendor/radiant contains a complete copy of the Radiant sources.&quot;
     end
@@ -72,7 +91,7 @@ module Radiant
       $LOAD_PATH.unshift &quot;#{RAILS_ROOT}/lib&quot; 
       super
     end
-    
+
     def load_error_message
       &quot;Please verify that you have a complete copy of the Radiant sources.&quot;
     end
@@ -82,11 +101,12 @@ module Radiant
     def load_initializer
       self.class.load_rubygems
       load_radiant_gem
+      # require 'initializer'
       super
     end
-
+      
     def load_error_message
-      &quot;Please reinstall the Radiant gem with the command 'gem install radiant'.&quot;
+     &quot;Please reinstall the Radiant gem with the command 'gem install radiant'.&quot;
     end
 
     def load_radiant_gem
@@ -96,7 +116,7 @@ module Radiant
         gem 'radiant'
       end
     rescue Gem::LoadError =&gt; load_error
-      $stderr.puts %(Missing the Radiant #{version} gem. Please `gem install -v=#{version} radiant`, update your RADIANT_GEM_VERSION setting in config/environment.rb for the Radiant version you do have installed, or comment out RADIANT_GEM_VERSION to use the latest version installed.)
+      $stderr.puts %(Missing the Radiant #{version} gem. Please `gem install -v=#{version} rails`, update your RADIANT_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RADIANT_GEM_VERSION to use the latest version installed.)
       exit 1
     end
 
@@ -129,7 +149,7 @@ module Radiant
       end
 
       def parse_gem_version(text)
-        $1 if text =~ /^[^#]*RADIANT_GEM_VERSION\s*=\s*'([!~&lt;&gt;=]*\s*[\d.]+)'/
+        $1 if text =~ /^[^#]*RADIANT_GEM_VERSION\s*=\s*[&quot;']([!~&lt;&gt;=]*\s*[\d.]+)[&quot;']/
       end
 
       private</diff>
      <filename>lib/generators/instance/templates/instance_boot.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>20fb5a3b601a2448e41762d96d50a761ec2072c5</id>
    </parent>
  </parents>
  <author>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </author>
  <url>http://github.com/saturnflyer/radiant/commit/846642739e5a09b83a154f27818ca1617c01b5b5</url>
  <id>846642739e5a09b83a154f27818ca1617c01b5b5</id>
  <committed-date>2008-10-06T10:41:07-07:00</committed-date>
  <authored-date>2008-10-06T10:41:07-07:00</authored-date>
  <message>updated instance_boot for newer rails</message>
  <tree>e285ce0e6a46e14a1e735a30fa47d7deb1e9d722</tree>
  <committer>
    <name>Jim Gay</name>
    <email>jim@saturnflyer.com</email>
  </committer>
</commit>
