Use template for your commits

Yes it’s great to add descriptions and unicorns 🦄 in your tickets and pull request but where content is really needed is in your commits. It will always be connected to your code. It’s a reference we (developers) have to care about.   So your commits needs to be structured and they need to contain […]

Difference between Kernel.load and Kernel.require

First of you may ask yourself: “But gosh! What is the difference between ‘require’ and ‘Kernel.require’?”. And the response is NONE! It’s the same. Ruby loads the Kernel module without a receiver and thus can be called in functional form: or Basically Kernel.load will reload every time the file. Where Kernel.require will load the file […]

Create a Rake task using Rake::Task

Yes it’s true you can create a rake task in a rake file this way: But let’s say, you want a gem to make available a rake task in the app loading it. The Rakefile of your application could look like this: The 2 last lines inject your new rake task in Rake.applications.tasks. The My::Gem::RakeTask.load […]

Reloading your gem in the dummy app

Where is the dummy Rails app? The dummy app is a Rails app located in It allows to test the gem directly in an app. How to reload the Gem on modification? This is done in 3 steps : in Gemfile, add the option require: false: in config/application.rb, insert the lib directory of the gem […]

Benchmarking sorting algorithms in Ruby

For some time now, I wanted to try the implementation of some simple sort algorithms in Ruby. So I did! I’ve implemented 4 sorting algorithms: – Quick sort – Merge sort – Bubble sort – Binary tree sort Quick sort It’s one of the most efficients. In average, it makes O(n.log(n)) comparisons to sort n items. […]