Permalink
Browse files

Fixed rails:freeze:gems for Windows (closes #3274) [paul@paulbutcher.…

…com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3963 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent eb1ae04 commit 8463cd646ec5b8f439577a7c2ca225179709b5ed @dhh dhh committed Mar 19, 2006
Showing with 15 additions and 10 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +13 −10 railties/lib/tasks/framework.rake
View
2 railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed rails:freeze:gems for Windows #3274 [paul@paulbutcher.com]
+
* Added 'port open?' check to the spawner when running in repeat mode so we don't needlessly boot the dispatcher if the port is already in use anyway #4089 [guy.naor@famundo.com]
* Add verification to generated scaffolds, don't allow get for unsafe actions [Michael Koziarski]
View
23 railties/lib/tasks/framework.rake
@@ -4,12 +4,12 @@ namespace :rails do
task :gems do
deps = %w(actionpack activerecord actionmailer activesupport actionwebservice)
require 'rubygems'
+ Gem.manage_gems
+
+ rails = version = ENV['VERSION'] ?
+ Gem.cache.search('rails', "= #{version}").first :
+ Gem.cache.search('rails').sort_by { |g| g.version }.last
- rails = if version = ENV['VERSION']
- Gem.cache.search('rails', "= #{version}").first
- else
- Gem.cache.search('rails').sort_by { |g| g.version }.last
- end
version ||= rails.version
unless rails
@@ -21,12 +21,15 @@ namespace :rails do
rm_rf "vendor/rails"
mkdir_p "vendor/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}"
+ chdir("vendor/rails") do
+ rails.dependencies.select { |g| deps.include? g.name }.each do |g|
+ Gem::GemRunner.new.run(["unpack", "-v", "#{g.version_requirements}", "#{g.name}"])
+ mv(Dir.glob("#{g.name}*").first, g.name)
+ end
+
+ Gem::GemRunner.new.run(["unpack", "-v", "=#{version}", "rails"])
+ FileUtils.mv(Dir.glob("rails*").first, "railties")
end
- system "cd vendor/rails; gem unpack -v '=#{version}' rails"
-
- FileUtils.mv(Dir.glob("vendor/rails/rails*").first, "vendor/rails/railties")
end
desc "Lock this application to latest Edge Rails. Lock a specific revision with REVISION=X"

0 comments on commit 8463cd6

Please sign in to comment.