Ruby Journal

Avoid Unless Syntax in a Chain of Conditions Statement

| Comments

Ruby gives us a nice human friendly unless which is equivalent to negation of if. Yet if we abuse using this method in a long complex statements, it could add more confusion for normal readers. In this article, I’ll give you one example to prove that you should not use unless in a chain of conditions statement.

Digesting Pumactl

| Comments

Puma is multi-threaded web server which is implemented in Ruby and has become a popular choice for many production servers in the world. Given its short time of development, you’ll likely to see issues. One of the issue that I and many people often bump into is processes management. By default, puma offers pumactl, yet this utitlity hasn’t lived up to expectation (this is a year ago), thus people seeks different approaches with custom bash script by calling puma directly, upstart, monit, etc. However, today when I revisit pumactl, this tool has been polished and now does exactly what it promises. In this short article, I’ll go through with you how to use pumactl to manage your puma processes.

Faster TravisCI Test

| Comments

Running test suite is time consuming. There are various techniques to optimize the runtime performance of the CI by stub/mock, parallel_test, etc. In this short tutorial, I’ll show you how to optimize your TravisCI test suite by splitting your test suit into concurrent jobs, which drastically improve the build time.

How to Uninstall All Ruby Gems

| Comments

In order to uninstall all gems, you have to loop through all entries in gem list with bash scripting. This method is very inconveninent. Thanks to Rubygems 2.1.0, you now could do it with one command.