Created
May 5, 2011 04:04
-
-
Save concept47/956517 to your computer and use it in GitHub Desktop.
This makes rake rails:freeze:edge work for your Rails 2 installation. find your rails gem then navigate to /lib/tasks/framework.rake ... locate a similar looking section and replace it with this
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'Lock to latest Edge Rails, for a specific release use RELEASE=1.2.0' | |
task :edge do | |
require 'open-uri' | |
require 'openssl' | |
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE | |
version = ENV["RELEASE"] || "edge" | |
target = "v#{version}" | |
commits = "http://github.com/api/v1/yaml/rails/rails/commits/master" | |
#url = "http://dev.rubyonrails.org/archives/#{target}" | |
url = "https://github.com/rails/rails/zipball/#{target}" | |
chdir 'vendor' do | |
latest_revision = YAML.load(open(commits))["commits"].first["id"] | |
puts "Downloading Rails from #{url}" | |
File.open('rails.zip', 'wb') do |dst| | |
open url do |src| | |
while chunk = src.read(4096) | |
dst << chunk | |
end | |
end | |
end | |
puts 'Unpacking Rails' | |
rm_rf 'rails' | |
`unzip rails.zip` | |
%w(rails.zip rails/Rakefile rails/cleanlogs.sh rails/pushgems.rb rails/release.rb).each do |goner| | |
rm_f goner | |
end | |
puts "Frozen to git revision #{latest_revision}" | |
File.open('rails/REVISION', 'w') do |revision| | |
revision.puts latest_revision | |
end | |
end | |
puts 'Updating current scripts, javascripts, and configuration settings' | |
Rake::Task['rails:update'].invoke | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment