1 desc "freeze rails edge"
3 ENV['SHARED_PATH'] = '../../shared' unless ENV['SHARED_PATH']
4 ENV['RAILS_PATH'] ||= File.join(ENV['SHARED_PATH'], 'rails')
5 ENV['REPO_BRANCH'] ||= 'trunk'
7 checkout_path = File.join(ENV['RAILS_PATH'], 'trunk')
8 export_path = "#{ENV['RAILS_PATH']}/rev_#{ENV['REVISION']}"
9 symlink_path = 'vendor/rails'
11 # do we need to checkout the file?
12 unless File.exists?(checkout_path)
13 puts 'setting up rails trunk'
14 get_framework_for checkout_path do |framework|
15 system "svn co http://svn.rubyonrails.org/rails/#{ENV['REPO_BRANCH']}/#{framework}/lib #{checkout_path}/#{framework}/lib --quiet"
19 # do we need to export the revision?
20 unless File.exists?(export_path)
21 puts "setting up rails rev #{ENV['REVISION']}"
22 get_framework_for export_path do |framework|
23 system "svn up #{checkout_path}/#{framework}/lib -r #{ENV['REVISION']} --quiet"
24 system "svn export #{checkout_path}/#{framework}/lib #{export_path}/#{framework}/lib"
32 get_framework_for symlink_path do |framework|
33 ln_s File.expand_path("#{export_path}/#{framework}/lib"), "#{symlink_path}/#{framework}/lib"
36 touch "vendor/rails_#{ENV['REVISION']}"
39 def get_framework_for(*paths)
40 %w( railties actionpack activerecord actionmailer activesupport activeresource ).each do |framework|
41 paths.each { |path| mkdir_p "#{path}/#{framework}" }