If a SOAP API expects you to call a remote method with arguments of complex types, Savon lets you manually...

devalot.com

Good article about ruby singleton classes.

Developing complex regular expressions quickly blows my mind. Here are some online regex editors that help you by highlighting matching...

makandra dev
semaphoreci.com

Capistrano 3 is a major rework of the framework and requires several adjustments to your deploy configuration files. The biggest...

gist.github.com

Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g...

makandra dev
plugins.jetbrains.com

There are times when you have a chunk of text that you want to do something with, e.g. replace something...

bugs.ruby-lang.org

TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby...

rubyinside.com

It is a common misunderstanding that all [op]=-operators work the same way, but actually they don't. ||= and &&=

iana.org

When using send_file (for example for attachments of any kind), make sure your application knows the correct mime types...

You can freeze any Ruby object to prevent further modification. If you freeze an ActiveRecord and try to set an...

If you want to grow a Ruby Array, you might find out about #fill but it is not really what...

makandra dev

Code folding is a very useful feature to me. It gives me a quick overview over a file and keeps...

When using threads, you must make your code thread-safe. This can be done by either locking (mutexes) all data...

Today I learned that Ruby on Rails has shipped with a built-in slug generator since Rails 2.2:

makandra dev
github.com

Nested exceptions for Ruby: When you rescue an error and then re-raise your own, you don't have to...

Web applications can be used by multiple users at the same time. A typical application server like Passenger has multiple...

If you need to log to a file you can use Ruby's Logger class: require 'logger'

This is useful to kill processes like ruby my-script.rb: pkill -f my-script.rb With great power comes great responsibility.

If you're on Ruby 2.3+ there's a <<~ operator to automatically unindent HEREDOCs: str = <<~MESSAGE Hello Universe!

If you want to sort values from an enumerable into two arrays based on whether they match a certain criteria...

xaprb.com

The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...

nandovieira.com

Postgres 9.4 introduces a new column type: jsonb. json and jsonb columns store data differently, so just compare the two...

Enumerable#count can do three things. With no argument provided, it returns the number of items. With an argument, it...

Array#flatten by default flattens an array recursively. To only flatten the array for e.g. one level, it takes an...