aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/tasks/framework.rake23
1 files changed, 13 insertions, 10 deletions
diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake
index 4ac7f7ebe0..ac612b8fb5 100644
--- a/railties/lib/tasks/framework.rake
+++ b/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"