Skip to content
Browse files

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
  • Loading branch information...
1 parent 35b4bdc commit 917189b076682063f389d7a1c767d4719d435f54 @jeremy jeremy committed
Showing with 21 additions and 20 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +19 −20 railties/lib/tasks/framework.rake
View
2 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)
View
39 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

0 comments on commit 917189b

Please sign in to comment.
Something went wrong with that request. Please try again.