Permalink
Browse files

Add stub for configuring your package manager

  • Loading branch information...
1 parent e1fdc8b commit e13d232150921cdf0ec3d713caefa628d235152e @josh josh committed Oct 17, 2009
@@ -1,4 +1,4 @@
-require 'digest/md5'
+require 'digest/md5'
require 'active_support/secure_random'
require 'rails/version' unless defined?(Rails::VERSION)
@@ -75,6 +75,10 @@ def create_config_files
end
end
+ def create_boot_file
+ copy_file "config/boot.rb"
+ end
+
def create_activerecord_files
return if options[:skip_activerecord]
template "config/databases/#{options[:database]}.yml", "config/database.yml"
@@ -1,12 +1,4 @@
-begin
- # Use Bundler
- require File.expand_path("../../vendor/gems/environment", __FILE__)
-rescue LoadError
- # Use Rubygems
- require 'rubygems'
-end
-
-require 'rails'
+require File.expand_path(File.join(File.dirname(__FILE__), 'boot'))
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
@@ -52,4 +44,4 @@
# g.template_engine :erb
# g.test_framework :test_unit, :fixture => true
# end
-end
+end
@@ -0,0 +1,15 @@
+# Package management
+# Choose one
+
+# Use Bundler (preferred)
+environment = File.expand_path('../../vendor/gems/environment', __FILE__)
+require environment if File.exist?(environment)
+
+# Use 2.x style vendor/rails directory
+vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
+Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) } if File.exist?(vendor_rails)
+
+# Load Rails from traditional RubyGems
+require 'rubygems'
+
+require 'rails'
@@ -1,9 +1,5 @@
-# Be sure to restart your server when you modify this file
-
-# Specifies gem version of Rails to use when vendor/rails is not present
-<%= '# ' if options[:freeze] %>RAILS_GEM_VERSION = '<%= Rails::VERSION::STRING %>' unless defined? RAILS_GEM_VERSION
-
# Load the rails application
require File.expand_path(File.join(File.dirname(__FILE__), 'application'))
+
# Initialize the rails application
Rails.initialize!

0 comments on commit e13d232

Please sign in to comment.