This week fellow Rocketeer Jonathan Jackson and I bring you the latest news in the Ruby and Rails communities in another episode of the Ruby5 podcast. Here is a quick roundup of what's new this week.
content_for in Rails templates is a really handy feature, but it is lacking in some respects. Enter the
nestive gem, which allows you to specify an
area in your view then append and prepend markup to it. You can also specify the layout to extend right in the markup!
We all know and love resty. It is a command-line tool that makes it easy to make multiple curl requests with complex settings. With so many people switching to zsh lately, this tool has fallen out of favor. Luckily there is a Ruby port of the library now that works in multiple shells and in Ruby itself. You can also configure it with a yml file!
I know you've cringed a little every time you had to write a rescue block. I do too, it's ok. The good news is that there is a better way. Rails provides a macro called
rescue_from that allows you to specify a method to execute in the event of an error instead of hard-coding a rescue block. This way, you can easily test the error routes and extend them in subclasses. When it's the right thing to do, this is a much cleaner way.
For those of you not using pry, your REPL of choice just got a lot better. A new library called binding.repl gives you many of pry's features in IRB and ripl.
So you've heard of Sandi Metz. You've likely seen her conference talks and if you haven't, you need to go on Confreaks right now and watch one. It's ok, I'll wait. Anyways, she published some coding style and design rules that are good common guidelines for us all. Thanks to the quick reactions of the Ruby community, we now have a tool that will provide metrics on your compliance to those guidelines called
sandi-meter. It comes with cool visualizations, too. Check it out!
Faye has been around for a long time and is finally celebrating its 1.0 release. If this is the first you're hearing of it, Faye provides a pub/sub messaging system for Ruby and node.js. It is a dependency for some popular gems, so you may already be using it indirectly. In any event, this is a big milestone for the team. Congratulations!
So that's it for this episode of Ruby5. If you haven't already, subscribe to the podcast and keep yourself up to date. Thanks for listening!