diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-08 10:43:40 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-08 10:43:40 +0000 |
commit | 917189b076682063f389d7a1c767d4719d435f54 (patch) | |
tree | 9c1e01cf5632a4403535421b76e49fbc16351456 /railties | |
parent | 35b4bdcff0e697765b562a74bd881e78de97f4d1 (diff) | |
download | rails-917189b076682063f389d7a1c767d4719d435f54.tar.gz rails-917189b076682063f389d7a1c767d4719d435f54.tar.bz2 rails-917189b076682063f389d7a1c767d4719d435f54.zip |
Correct versioning in :freeze_gems Rake task. Closes #2778.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2941 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/tasks/framework.rake | 39 |
2 files changed, 21 insertions, 20 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 6df4aeea07..d5035a68d9 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Correct versioning in :freeze_gems Rake task. #2778 [jakob@mentalized.net, Jeremy Kemper] + * Added an omnipresent RailsInfoController with a properties action that delivers an HTML rendering of Rails::Info (but only when local_request? is true). Added a new default index.html which fetches this with Ajax. [Sam Stephenson] *0.14.3 (RC4)* (November 7th, 2005) diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake index fbb64d83fe..37452a37b1 100644 --- a/railties/lib/tasks/framework.rake +++ b/railties/lib/tasks/framework.rake @@ -1,29 +1,28 @@ desc "Lock this application to the current gems (by unpacking them into vendor/rails)" task :freeze_gems do + deps = %w(actionpack activerecord actionmailer activesupport actionwebservice) + require 'rubygems' + + rails = if version = ENV['VERSION'] + Gem.cache.search('rails', "= #{version}").first + else + Gem.cache.search('rails').sort_by { |g| g.version }.last + end + + unless rails + puts "No rails gem #{version} is installed. Do 'gem list rails' to see what you have available." + exit + end + + puts "Freezing to the gems for Rails #{rails.version}" rm_rf "vendor/rails" mkdir_p "vendor/rails" - deps = %w( actionpack activerecord actionmailer activesupport actionwebservice ) - if version = ENV['VERSION'] - puts "Freezing to the gems for Rails #{version}" - require 'rubygems' - if rails = Gem.cache.search('rails', "= #{version}") - rails.dependencies.select { |g| deps.include? g.name }.each do |g| - system "cd vendor/rails; gem unpack -v '#{g.version_requirements}' #{g.name}; mv #{g.name}* #{g.name}" - end - system "cd vendor/rails; gem unpack -v '= #{version}' rails" - else - puts "No rails gem version #{version} is installed. Do 'gem list rails' to see which versions you have available." - exit - end - else - puts "Freezing to your latest Rails gems" - for gem in deps - system "cd vendor/rails; gem unpack #{gem}" - FileUtils.mv(Dir.glob("vendor/rails/#{gem}*").first, "vendor/rails/#{gem}") - end - system "cd vendor/rails; gem unpack rails" + rails.dependencies.select { |g| deps.include? g.name }.each do |g| + system "cd vendor/rails; gem unpack -v '#{g.version_requirements}' #{g.name}; mv #{g.name}* #{g.name}" end + system "cd vendor/rails; gem unpack -v '= #{version}' rails" + FileUtils.mv(Dir.glob("vendor/rails/rails*").first, "vendor/rails/railties") end |