Italy, baby!
In a day or three I will be in Pisa for Rails to Italy where I am giving a talk on Ruby patterns in the Rails internals. Shout if you happen to be in the area and want to meet up, you know how it works.
In a day or three I will be in Pisa for Rails to Italy where I am giving a talk on Ruby patterns in the Rails internals. Shout if you happen to be in the area and want to meet up, you know how it works.
A lot of people are on Rails Edge nowadays. Besides all the nifty new features they also encounter bugs. There are two ways to work around these bugs:
If you decide to apply patches, you’re going to need some help. Our solution is to put all the patches that need to be applied in vendor/patches and put the following Rake task in lib/tasks/patches.rake:
task :patch => 'patches:apply'
namespace :patches do
desc "Apply all patches from vendor/patches to root"
task :apply do
Dir.chdir(RAILS_ROOT) do
Dir["vendor/patches/*"].each do |patch|
system "patch -p0 < \"#{patch}\""
end
end
end
desc "Revert all patches applied in vendor/plugins and vendor/rails" +
"through SVN"
task :revert do
system "svn revert --recursive vendor/plugins vendor/rails"
end
end
Assuming you’re using Capistrano 2, you can add the following to your deployment recipe to automatically run the patches for each deployment.
after "deploy:update_code", "deploy:patch"
namespace :deploy do
task :patch, :roles => :app do
run "rake patches:apply"
end
end
Now all you have to do is make sure that all the patches apply cleanly and remove them when they’re accepted into Rails.