1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

rake rails:freeze:edge using http://dev.rubyonrails.org/archives/rails_edge.zip instead of Subversion

This commit is contained in:
Jeremy Kemper 2008-04-10 22:15:50 -07:00
parent ed99dda174
commit 4b17082107

View file

@ -38,40 +38,30 @@ namespace :rails do
end end
end end
desc "Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0)" desc 'Lock to latest Edge Rails'
task :edge do task :edge do
$verbose = false require 'open-uri'
`svn --version` rescue nil
unless !$?.nil? && $?.success? chdir 'vendor' do
$stderr.puts "ERROR: Must have subversion (svn) available in the PATH to lock this application to Edge Rails" puts 'Downloading Rails'
exit 1 File.open('rails_edge.zip', 'wb') do |dst|
open 'http://dev.rubyonrails.org/archives/rails_edge.zip' do |src|
while chunk = src.read(4096)
dst << chunk
end
end
end end
rm_rf "vendor/rails" puts 'Unpacking Rails'
mkdir_p "vendor/rails" rm_rf 'rails'
`unzip rails_edge.zip`
svn_root = "http://dev.rubyonrails.org/svn/rails/" %w(rails_edge.zip rails/Rakefile rails/cleanlogs.sh rails/pushgems.rb rails/release.rb).each do |goner|
rm_f goner
if ENV['TAG'] end
rails_svn = "#{svn_root}/tags/#{ENV['TAG']}"
touch "vendor/rails/TAG_#{ENV['TAG']}"
else
rails_svn = "#{svn_root}/trunk"
if ENV['REVISION'].nil?
ENV['REVISION'] = /^r(\d+)/.match(%x{svn -qr HEAD log #{svn_root}})[1]
puts "REVISION not set. Using HEAD, which is revision #{ENV['REVISION']}."
end end
touch "vendor/rails/REVISION_#{ENV['REVISION']}" puts 'Updating current scripts, javascripts, and configuration settings'
end Rake::Task['rails:update'].invoke
for framework in %w(railties actionpack activerecord actionmailer activesupport activeresource)
system "svn export #{rails_svn}/#{framework} vendor/rails/#{framework}" + (ENV['REVISION'] ? " -r #{ENV['REVISION']}" : "")
end
puts "Updating current scripts, javascripts, and configuration settings"
Rake::Task["rails:update"].invoke
end end
end end