Railsware Blog

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

Hideable React component using HOC

Imagine that we have a very simple React component Hello which greets a user with a message:

Using Configurable Shared Examples in RSpec

Shared examples are a good tool to describe some complex behavior and reuse it across different parts of a spec. Things get more complicated when you have the same behavior, but it has some slight variations for different contexts. In this case it’s easy to end-up having a bunch of …

Debugging Capybara: screenshot of error page on CircleCI

Having real screenshot of a failed integration spec can save hours of debugging. We had screenshot with error on the local development environment, and wanted to have it on Continuous Integration server. Luckily for us, it’s a real no-brainer, if you use CircleCI. There is no need for custom S3 …

Make AngularJS 1.0.7 work with Jasmine 2.0

During setup of Jasmine 2.0 for AngularJS 1.0.7 application it turned out that they are not compatible. The reason is that Angular 1.0.7 is compatible with the older version of Jasmine – 1.3. And there were several breaking changes in Jasmine private API which was used by AngularJS. There were …

Rails logging into several backends

Sometimes, it’s required to setup Rails logger for storing logs into several backends. In our case we decided to use Loggly, but also wanted to leave old file-based logging. Despite the actual solution is very simple, it’s hard to find it. The best match on StackOverflow suggests to create some …

Better Ruby: choosing convention for class methods definition

Ruby doesn’t have procedural module akin to Python or Perl module. Usually, one uses class methods as a typical way to mimic this functionality. Class methods in Ruby are also very handy for supporting instance methods with fabrics and other common-for-class functionality. This is clearly seen in ActiveRecord::Base with dozens …