Hire Us

Railsware Blog

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

Make AngularJS 1.0.7 work with Jasmine 2.0

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 …

Git clean-up tutorial

Git Clean-up in Local and Remote Branches, Repositories

After working with branch per feature for a while any Git-repository becomes a mess of outdated and not finished branches. To deal with this issue, we need to clean-up three kinds of branches: In this tutorial we suppose, that “master” – is a default branch, where everything is merged (for …

Rails logging into several backends

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 …

Ruby: choosing convention for class methods definition

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 …

Quickly Share Git Repository

Taming The Git-Daemon To Quickly Share Git Repository

I was once in a hurry to share GitHub repository with a colleague who didn’t have access to it and we decided to use local git-daemon. However, handling all the little quirks that would make it work took a lot more efforts than just dropping a repository archive via Skype. …

Capistrano recipe for checking Travis CI build status

Using Continuous Integration is a must for any mature development process, but in the hurry of delivering to production it’s easy to forget about checking build status before issuing “cap production deploy”. What if while running Capistrano deployment, script will automatically check CI status and prevent us from delivering a …

Speeding up Authlogic login for Postgres and MySQL

Update (2012, 10 December) Authologic-team patched weird behavior with (I)LIKE and now Postgres users can make everything without clutches. Just use new version 3.2.0. Introduction User authentication – is the most utilized part of Authlogic gem. But default configuration of current version(3.1.2) doesn’t use database indexes or their usage is …

yield-gotcha every Ruby developer should be aware

yield-gotcha every Ruby developer should be aware of

Preface Using yield and blocks is what makes Ruby so different from other scripting languages. But in some cases yield can lead to unpredictable behavior and it’s crucial to understand what can go wrong. Let’s consider next code: File.open(“/etc/hosts”, “r”) do |f| content << f.read end File is opened, used …