RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
October 11, 2014
A little brief about memoization in Ruby, Javascript and Python.
Check it out here!.
October 10, 2014
I just released queue_classic 3.0.2. I you are using it. Please see the upgrade instructions in the README.

I am also working on getting queue_classic to 3.1, with more support for Active Job. It works right now, it could just be a bit better :)

Things like scheduling that had to be done with a gem should be in core soon-ish (there is a PR), ActiveRecord's DB connection will be detected and used by default (can be turned off).

If you would like to help, let me know!

More on all that in this issue:
I found this great blog by Noah Gibbs, to something I've been wording about for a while. Quite often some of my forms get really into the nesting by name="name[1][key1][key2][]", this blog post provides information on how to test it out with IRB so I know exactly what I'm generating.
I just released version 0.2.0 of kibana-rack, a Rack middleware library that embeds Kibana in a Rack application and creates a proxy to Elasticsearch.

This version upgrades Kibana to the latest version (3.1.1).
Slides & list of resources for Ruby/Rails for beginners (originally made for a lecture for students of Gdańsk University of Technology but well, why not to share it further).
Rebuild a Gem: Rack
A post on building out a micro version of Rack. Check it out.
We've just released a Rails template to make creating new projects easier for us and for anyone who wants to use it. Check it out!
I wrote a gem to manage business hours in ruby.
October 09, 2014
I just published ClassyCancan. It's a tiny little gem that helps to create some cleaner ability definitions for Cancan and Cancancan.
We've recently discovered that MRI implements Tail Call Optimisation (TCO). Check out our blog post for a short summary of what we found about the TCO in MRI.
October 08, 2014
After couple of last months of slower development, I decided to take the job of solving all the open issues. While doing that I also rewrote the internals, bringing up some new features, reduced memory usage, robust command-line execution and many bug fixes. You can see the complete changelog here.

The new version brings lots of nice stuff, so I urge you to try it out, and be sure to check out the renewed readme.
I just released Inch 0.5.2 and wrote a blog post about it.

Also, this release includes basic Elixir support, which I am trying to start a discussion about.
Wisper is a micro library providing Ruby objects with Publish-Subscribe capabilities for use in Hexagonal and Domain Driven style architectures.

Wiki: How to Handle events asynchronously
Practical advice for Minitest's parallelization including how it works, when and how to use it, and when you might want to think twice about it.
I just wrote a blog post on how Kernel#caller works with a simple rails example that inspect the request cycle and shows rails source code.
TDD Articles
Check out the TDD Articles at Your feedback is very much appreciated.
Last year I wrote a post about CMS Trap, a trap you fall into when you try to speculate your app's architecture prematurely. It had great success on HN, but didn't reach enough rubyists, and as a rubyist I mainly intended the article for us. This submission is my attempt to rectify this.
After participating (and winning) several hackathons over the years, I’ve come to appreciate how nicely Rails generates prototypes that build and deploy quickly. Hackathon champions will assert that the secret sauce to winning hackathons is building an actual product that has real validation from potential users. This is a hard goal to achieve when everyone is short on sleep and time. Rails will get your app there.

Here are my simple dos and don'ts for creating a winning Rails app at a hackathon... Continue Reading...
The team walks through how we switched ElasticSearch versions in production without downtime
October 07, 2014
Pronto performs quick automated code reviews with the help of various analysis tools (RuboCop, Brakeman, Flay, etc.) by checking only the introduced changes. And since 0.3, it's even faster and able to comment on pull requests. Check it out: Pronto.
Registration has opened for the 2014 Rails Rumble! Reserve a spot for your team today - don't miss out! We're expecting to see an amazing bunch of apps now that everyone will be deploying to Heroku.
There are lots of good places to learn Ruby. But learning isn’t just reading books or watching videos. It’s running head-first into a problem, getting stuck, struggling, getting frustrated, looking things up, having it click, playing around with it, and finally (finally!) getting something working. You have to use the things you learn, or they won’t stick with you. And there are a few great ways I’ve found to do just that.
Cleaning up a Rails routes file
Here are some notes on techniques to clean up a cluttered Rails routes file.
I've updated Everyday Rails Testing with RSpec to cover RSpec 3, Rails 4.1 (and newer), the latest Capybara and Factory Girl, testing APIs, and more. It's 190-ish pages, DRM-free, and available in PDF, MOBI, and EPUB formats. Free for existing readers. Hope you'll check it out!
I’ve been experimenting with deis, which has come a long way in a very short time. Trying to track the explosion of tech in what I will loosely call ‘Dockerland’ is impossible. So. Much. Stuff. Read The Vibe.
October 06, 2014
I wrote a deep explanation about how rails handles requests, have a look !
Welcome to RVM blog
I just blogged about my way of testing ruby initializers.
If you implemented your own authentication engine, you can still move to Devise. Even when you have a custom encryptor that needs to stay. Here's an article on how to do it
October 05, 2014
Green Ruby News #87
Finished composing Green Ruby 87. Bunch of links this week, I had to make some selection.
October 04, 2014
We wrote an article to explain how the Hash works in Ruby.

We looked at the hash data structure, hashing functions, conflict resolution and growth, how it's implemented in Ruby and a peek at the history of changes made to the hash in MRI Ruby.
So everybody must have heard about the shiny new ActiveJob which is going to be released in the next Rails 4.2 release. ActiveJob is a nice addition to Rails stack that helps standardise the background job interface. It works with many adapters on the market such as Resque, Sidekiq. In the article by Envato's engineer Trung Lê (@joneslee85) will guide you through how to configure ActiveJob with Sidekiq adapter, additionally he will show you few secret gems behind the ActiveJob such as multi-queue prioritisation, callbacks, exceptions handling, background mailer and live object parsing (GlobalID).
October 03, 2014
Part 2/n in a series exploring the corners of Enumerable. This part covers using the partition method to eliminate a conditional. Pudding may or may not be involved.
October 02, 2014
Do you like speed? Do you hate unnecessary object allocation? Well then you just got a got a 2 to 4% performance boost in Rack & Rails for free.
Current web platform primitives are are not sufficient to deliver an extensible and perf-friendly platform - we need to fix that.
Unless you remember to put :DoNotReverseLookup => true into your WEBrick config, reverse DNS lookup will happen for every incoming connection, potentially causing serious latency.
My story: WEBrick and Socket.do_not_reverse_lookup: A Tale in Two Acts
Technical details: Fix regression bug in WEBrick's :DoNotReverseLookup config option implementation
The Asset Pipeline is the canonical way of packaging assets in Rails. It can make things easy and is a good approach for most Rails applications, but at times it can makes things harder and shows limitations. So, you might consider using an alternative for bundling your assets.
We just wrote a tutorial on processing payments with Paypal for Rails apps. It's actually got a lot simpler since the last time I looked at it.

Paypal Payment Processing for Rails Apps
October 01, 2014
Katrina Owen: Overkill
Here's video for Katrina Owen's talk, Overkill, from the recent E4E developer conference.
Practicing Ruby Scavenger Hunt
In celebration of the fact that Practicing Ruby's archives are now completely open to the public, I've put together a little contest. You can read the rules here and participate without signing up for anything.

First prize is a detailed code review from me on any Ruby project, and the Top 5 will be invited to a group session where we practice our programming skills together.

But even if you're not looking to win, it should be fun to read a bunch of interesting Ruby articles and code samples, right? :-)

You can follow me on Twitter (@practicingruby) to see ongoing updates about the contest. Happy hunting!
Preserving technical knowledge
Some thoughts on preserving technical knowledge as devs change jobs.
Your code is not only interpreted by a machine, but by fellow programmers as well. Here's a few words describing How RuboCop can ease your code review pains and why style guides can be useful for team work.
I posted new atricle titled Absolutes as an AntiPattern. Hope you enjoy!
Input/Output in Ruby
Input/Output, generally referred to as I/O, is a term that covers the ways that a computer interacts with the world. Screens, keyboards, files, and networks are all forms of I/O. Data from these devices is sent to and from programs as a stream of characters/bytes.

Learn about Ruby's beautiful, duck-typed approach to Input/Output.
September 30, 2014
66 Useful Links from RESTFest 2014
If you missed RESTFest 2014, or want to know where you should follow up, Eric Oestrich collected 66 useful links at the conference. Enjoy!
How do gems work?
Gems might seem magical. But with a little investigation, they’re pretty easy to understand.
The theft Ruby gem allows for property-based testing in Ruby — generating valid, randomly-generated input and validating that a particular property is true.
Decorator Pattern in Ruby
Decorators allow us to add behavior to objects without affecting other objects of the same class. The decorator pattern is a useful alternative to creating sub-classes. We will look at an example where we use subclassing to solve a problem, and then look at how decorator objects provide a better solution. [Continue reading...]
I wrote a blog post on how we cleaned up our locales on a larger Rails project. See the post here.
“Class-oriented programming” over-emphasizes classes. Class-oriented code can only reference constants, which results in classes which use inheritance instead of composition.

This becomes a problem when you want to mix static state and runtime state, because static state is viral, as static state can only compose other static state.

Avoid passing class names as method parameters as much as possible.