aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-10-19 18:10:14 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-10-19 18:10:14 -0700
commit3072bf75557346f1e70c47baef0fba205bc39c51 (patch)
tree6c857f7689024e47c705a74f8b56245500951035
parenta49c3b03650b3193cc9440a3b219ab7f19326297 (diff)
downloadrails-3072bf75557346f1e70c47baef0fba205bc39c51.tar.gz
rails-3072bf75557346f1e70c47baef0fba205bc39c51.tar.bz2
rails-3072bf75557346f1e70c47baef0fba205bc39c51.zip
Check for bundler environment or 2.x-style vendor/rails + rubygems
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/boot.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/boot.rb b/railties/lib/rails/generators/rails/app/templates/config/boot.rb
index 44c884623e..2c527b4a4a 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/boot.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/boot.rb
@@ -1,17 +1,15 @@
-# Package management
-# Choose one
-
+# Use Bundler (preferred)
environment = File.expand_path('../../vendor/gems/environment', __FILE__)
-vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
-
if File.exist?(environment)
- # Use Bundler (preferred)
require environment
-elsif File.exist?(vendor_rails)
- # Use 2.x style vendor/rails directory
- Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
+
+# Use 2.x style vendor/rails and RubyGems
else
- # Load Rails from traditional RubyGems
+ vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
+ if File.exist?(vendor_rails)
+ Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
+ end
+
require 'rubygems'
end