Italy, baby!

Norbert Crombach, 22 Oct 2007, 19:39 in ruby on rails and events (edit).

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.

No comments yet

Patching Rails Edge to stay bug free

Manfred Stienstra, 11 Oct 2007, 21:39 in ruby on rails and tools (edit).

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:

  1. Lock your Rails external to an older revision or freeze it to vendor
  2. Find a patch on Trac or write one of your own and apply it

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.

2 comments

Ruby Banter #006

Norbert Crombach, 09 Oct 2007, 14:35 in ruby on rails and video (edit).

Today we bring you the next episode, Function Composition: Redux.

Manfred and Norbert

No comments yet

Good news: Online shopping not as scary anymore

Thijs van der Vossen, 05 Oct 2007, 09:32 in web (edit).

Newspaper with header ‘Online shopping: not as scary anymore’

1 comment