RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

robmiller — 6 posts

Have you ever hand-rolled your own code for persisting a hash to a file? Don't do that! The standard library has you covered: use PStore instead, and gain transactions, multi-process safety, and more.
People often represent filesystem paths as strings in Ruby. But there's a better option, and it comes as part of the standard library: Pathname. Let's take a look at why it's better.
You've probably used Nokogiri as a library to scrape sites. But did you know you could use it as a standalone script from the command line, too?
A break-down of all the tricks used in Konstantin Haase's "Almost Sinatra", an ultra-golfed version of the Sinatra framework written in just 999 bytes of code.
ARGF in Ruby
ARGF is an underused element in Ruby, but it makes writing well-behaved Unix utilities pleasingly straightforward.
Useful flags for using Ruby in shell one-liners or as part of a Unix pipeline.