Find out where a rake task is defined
Have you ever wondered where a particular rake task is defined? Enter rake -W (introduced in rake 0.9): $ rake -W db:schema:load rake db:schema:load /Users/bozhidar/.rbenv/version...
Have you ever wondered where a particular rake task is defined? Enter rake -W (introduced in rake 0.9): $ rake -W db:schema:load rake db:schema:load /Users/bozhidar/.rbenv/version...
One of the problems newcomers to Ruby experience is that there are often quite a few ways to do same thing. For instance - you can obtain the number of items in Enumerable objects (instances of cla...
As APIs evolve it’s inevitable that portions of them will be deprecated. Generally it’s fairly easy to find out what’s deprecated, but for several reasons that’s not the case in Ruby: Deprecati...
People are often confused about the fact that there are two ways to created procs in Ruby - via Kernel#proc and Proc.new. Let’s see them in action: Proc.new { true } # => #<Proc:0x007fe35440...
2013 was a good year for me in many aspects. I’ll share here some of the programming-related achievements of mine over the year that made me somewhat proud of myself. Achievements Ruby RuboCop...
Projectile 0.10.0 is out! This might come as a surprise for people tracking Projectile’s development, since recent snapshots were using 1.0 as the version number, so allow me to explain. I’ve been...
Sometimes we’d like to build a new collection object from the elements of another collection. One trivial example would be element occurrence counting, which basically means you need to build a ha...
Some Rubyists, when faced with the task of matching against the beginning or the end of a string, are prone to using ^ and $ in their regular expressions. Most of the time the code will seem to wor...
Good news, everyone - RuboCop 0.14 was just released! Generally I announce RuboCop releases in only 140 characters, but this time I’ll make an exception. This release is more significant than most...
Recently we discussed how you can use String#gsub with a block. Today we’ll examine another somewhat unknown feature of the gsub method - the ability to supply a replacement hash as the second argu...