Openhood

Openhood Experiments

Let's share our tech experiments and discoveries.
By Openhood

Add routes at runtime on Rails 3

Sometimes you just want to take the forbidden path. We had the case quite recently, while testing a Paypal integration. We did want to add a route to a fake Paypal service with a link back to our website after succesful payment, but at the same time we didn’t want to polute our routes.rb just for test purpose. Hopefully, it’s still possible to add routes at runtime even on Rails 3. The issue is calling Rails::Application.routes.draw clears all existing routes and after that no further route can be defined. The solution is inspired by how Rails is doing route reloading:

Read more

Read more
By Openhood

Rack::Test warning on Ruby 1.9.x

If you’ve tried to use Rack::Test on Ruby 1.9.x, which is the default when using capybara for exemple, you’ve probably been bugged by nasty warning like this one:

Read more

Read more
By Openhood

Cucumber with Gherkin Parser

The Cucumber team released some days ago a beta of the 0.7.0 version. With this release comes one thing we were waiting for a long time : Gherkin integration.

Read more

Read more
By Openhood

Mirror a GIT Repository for Backup

Here’s a quick way to easily maintain a complete mirror of a git repository. This is especially useful for backup.

Read more

Read more
Copyright © 2024 Openhood SARL