mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
35b4bdcff0
commit
917189b076
2 changed files with 21 additions and 20 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue