Railsware Blog

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

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 is opened, used in block and automatically closed after leaving …