DevSnack #48: Rails is a wonderful tool, but day-to-day it can be tempting to lean on a lot of the magic it provides without really understanding it. But Ruby started out as, and still is, a powerful scripting language with a vibrant community. Having been designed from the ground up with “programmer happiness” in mind, digging into pure Ruby can reveal some delightful gems (pun absolutely intended). I have also found that when I pause to dive head first into a pure-Ruby project, I come back to Rails more grounded, with a clearer sense of the mechanics under the magic.
It’s easy to forget that Ruby existed for over a decade before it was popularized by Rails. This fantastic interview with Matz himself by the guys at the Changelog (@changelog) goes deep into the history and influences of Ruby.
Web scraping, while messy, is still very much a viable data-collection tool. In this tutorial, Ruby developer Rob Miller (@robmil) shows how to leverage Nokogiri’s command-line interface and common Bash commands to scrape and parse data from a website without a public API.
#3 – About the Ruby squiggly heredoc syntax
One could do worse than follow the musings of Avdi Grimm (@avdi). His enthusiasm and curiosity for Ruby is infectious. In this tasty morsel, he explains the reasoning for a rather exotic bit of new syntax in Ruby 2.3. Like it or love it, it’s a trip.
Yes, back to the basics. So much of what distinguishes a Ruby-flavored method from its equivalents in other languages can be found in the Enumerable module. In this post from Joel Quenneville (@joelquen), take a deeper dive into what makes this module tick and makes all those yummy one-liners possible.
#5 – Rails vs. Sinatra
Time to spin up a new app? Before you tap out
rails new yet again, consider the under-rated, bare-bones Ruby web framework, Sinatra. This compare/contrast piece by PJ Hagerty (@) walks through the process of getting started and tapping into an external API with each framework. If nothing else, Sinatra’s bare-bones approach can be a great training ground, and help to develop a deeper understanding of some of the tools we take for granted in Rails.
DevSnack by Moove-it is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.