Railsware Blog

on product management, engineering, design, culture and many more...

Share Rails configuration to Javascript

Share Rails configuration to Javascript

The usual way of storing Rails configuration data are YAML files. In one of our previous posts, we talked about proper way of dealing with Rails configuration. Nowadays, Javascript applications built on top of RESTful API are common practice, and in cases like this configuration data might be duplicated across …

Pitfalls of Rspec boolean matchers

Pitfalls of Rspec boolean matchers

Rspec provides a bunch of build-in matchers. They include matchers that help us work with boolean values. But not always these matchers are safe to use. be_true and be_false matchers I guess everybody used RSpec matchers be_true and be_false. There are a few examples with them:

but it’s good …

Time-comparison-in-Ruby

Time comparison in Ruby

I believe every ruby developer has faced time comparison issue at least once and tests are one of the possible areas where it may happen. RSpec message like this may confuse:

What’s wrong? Investigation Let’s create two Time objects:

At the first glance, they are equal. But it’s …

Interconnecting Elixir nodes

Interconnecting Elixir nodes

Elixir is a functional language built on top of Erlang VM. Therefore it uses Erlang mechanism for communication with nodes. Erlang has one simple rule: everyone connects to everyone. It provides a simple authentication mechanism by tokens called cookie. In this article I want to show how to use remote …

Capistrano recipe for your favourite CI

The quality of features going to production is very important; and to guarantee the highest quality we use Continuous Integration in our everyday workflow. In one of his recent posts Sergii Boiko has described how to check Travis CI build status before delivering new code to production. Afterwards, we’ve also …

Rails configuration in the proper way

Rails configuration in the proper way

Usually Rails application has multiple environments – production, development, test and staging; and quite often application behaves differently in each environment. Rails provides a simple way to inspect current environment:

But abusing Rails.env for adjusting application behaviour leads to serious issues with future configuration changes. We’ll discuss these issues …

Globalize Your Configuration

Quite a lot of applications face the problem of storing configuration data, where configuration differs for development, test and production environments. Yaml files is a common way of organising application settings. They help make our configuration clean, as well as allow loading it somewhere to constant or global variable and …