aboutsummaryrefslogtreecommitdiffstats
path: root/railties/environments/boot.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-11-23 04:40:48 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-11-23 04:40:48 +0000
commit958e9a36a9b5929f9cd28b15a4d50d6d3f821e18 (patch)
tree51c5cfb550141ded023c19c4686a043f8d3bb327 /railties/environments/boot.rb
parent3805c12a807557e9c91cd7e0e2f337aaf99781f6 (diff)
downloadrails-958e9a36a9b5929f9cd28b15a4d50d6d3f821e18.tar.gz
rails-958e9a36a9b5929f9cd28b15a4d50d6d3f821e18.tar.bz2
rails-958e9a36a9b5929f9cd28b15a4d50d6d3f821e18.zip
Made RAILS_GEM_VERSION work for beta gems too, so specifying 1.1.6 will give you 1.1.6.4520 if available [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5614 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/environments/boot.rb')
-rw-r--r--railties/environments/boot.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/environments/boot.rb b/railties/environments/boot.rb
index 9a094cbc6d..39339fd229 100644
--- a/railties/environments/boot.rb
+++ b/railties/environments/boot.rb
@@ -22,7 +22,8 @@ unless defined?(Rails::Initializer)
rails_gem_version = $1
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
- rails_gem = Gem.cache.search('rails', "=#{version}").first
+ # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
+ rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
if rails_gem
require_gem "rails", "=#{version}"