diff options
author | Carl Lerche <carllerche@mac.com> | 2010-01-31 19:40:45 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-01-31 19:48:42 -0800 |
commit | a54654de1c9c11d20b4359c4aa01a6dac55aa0cf (patch) | |
tree | 6c5bd1d1c9c36c6a3b3612f20a4f560b50024398 /railties/lib | |
parent | 4cbb9db0a5ff65b0a626a5b043331abefd89e717 (diff) | |
download | rails-a54654de1c9c11d20b4359c4aa01a6dac55aa0cf.tar.gz rails-a54654de1c9c11d20b4359c4aa01a6dac55aa0cf.tar.bz2 rails-a54654de1c9c11d20b4359c4aa01a6dac55aa0cf.zip |
Update the generated Gemfile and config/boot.rb to work with bundler 0.9
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/generators/rails/app/templates/Gemfile | 2 | ||||
-rw-r--r-- | railties/lib/generators/rails/app/templates/config/boot.rb | 25 |
2 files changed, 16 insertions, 11 deletions
diff --git a/railties/lib/generators/rails/app/templates/Gemfile b/railties/lib/generators/rails/app/templates/Gemfile index 7b5c89c3e2..4db2b3e46c 100644 --- a/railties/lib/generators/rails/app/templates/Gemfile +++ b/railties/lib/generators/rails/app/templates/Gemfile @@ -1,4 +1,6 @@ # Edit this Gemfile to bundle your application's dependencies. +source :gemcutter + <% if !dev_or_edge? %> gem "rails", "<%= Rails::VERSION::STRING %>" <% end -%> diff --git a/railties/lib/generators/rails/app/templates/config/boot.rb b/railties/lib/generators/rails/app/templates/config/boot.rb index 7fc1aeaeb8..70bd40bc4c 100644 --- a/railties/lib/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/generators/rails/app/templates/config/boot.rb @@ -1,16 +1,19 @@ # Use Bundler (preferred) -environment = File.expand_path('../../vendor/gems/environment', __FILE__) -if File.exist?("#{environment}.rb") - require environment - -# Use 2.x style vendor/rails and RubyGems -else - vendor_rails = File.expand_path('../../vendor/rails', __FILE__) - if File.exist?(vendor_rails) - Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) } - end - +begin + require File.expand_path('../../vendor/environment', __FILE__) +rescue LoadError require 'rubygems' + require 'bundler' + Bundler.setup + + # To use 2.x style vendor/rails and 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 <% unless options[:skip_activerecord] -%> |