RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
October 06, 2014
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.
September 29, 2014
Just published new blog post about 10 skills you need to master to become a better Ruby developer.
Presenters in Rails
When your models are bloated with methods that are only used in views, it might be a good time to refactor them. Moving that logic into helper modules might be OK in some cases, but as the complexity of your views grows, you might want to look at presenters. In this article, I will walk through how I refactored views to use presenters instead of helper methods. [Continue reading...]
Due to an unprecedented influx of sensitive data that is managed and collected on mobile devices, ITTIA is offering a state-of-the-art bidirectional synchronization solution for Android apps that enables big data collection on-the-go. ITTIA DB SQL communicates with ITTIA DB Sync, and uses a back-end RDBMS to store device data in existing tables and download updates specific to each device.
Green Ruby News #86
Green Ruby News #86 is out.
I just wrote a guide for adding a staging environment to Rails explain why and how to it set up: how to copy data from your production environment, how to deal with mails, the question to ask for...
September 28, 2014
finite_machine version 0.9.2 brings important fixes to transitions involving :any type state and thread safety.
I just released activerecord-time-scope, which provides sets of useful scopes for time-related columns.
Devise is considered the best-of-breed authentication solution for Rails apps. In this blog post, we go over how Devise is built on top of Warden, how to use it in a Rails app, and how to write tests for it.

How to use Devise in Rails for Authentication
September 27, 2014
Website screenshot server
I made this tiny gem because I couldn't find any solution for ad hoc ruby code reloading that would also work on Windows (e.g. shotgun and rerun use fork(), so they're unix-only). Hope you find it useful and let me know what you think!
September 26, 2014
Rails Disco tries to get the best bits of event sourcing integrated into a Ruby on Rails tool stack. The adds commands, events and projection and some Rails generators. I think it works very good. I seek for help to maintain this project. I believe in the idea, but lack the time to get this thing production ready. Every feedback and help is appreciated.
A blog post about how we at CookiesHQ used Google's geocoder to seed our database with journeys for testing geomatching using PostGIS.
I’m the newest Rails Support Engineer to join Ninefold and a big advocate of developer bootcamps. Her talk sounded like it would be perfect for where I am in my career.

An excellent point that Kate made was that you shouldn’t only rely on your senior developers to teach your junior ones. As the common saying goes, “you don’t know something until you teach it.” The last person who was taught should be doing the teaching. This will definitely cut down on the amount of cynicism that can interfere with the learning process.

Kate broke down the four phases of onboarding for a new developer:
Read about the 4 phases of onboarding a Junior dev.
September 25, 2014
A short, annotated blog post on how to use Passenger standalone in development with smooth integration of debugger and pry.
Brian Knapp shares some lessons learned from his landmark Ruby web framework benchmarking post. Really great post.
We just posted a complex Barcelona Ruby Conference (#Baruco) summary written by Phillip Boksz.
September 24, 2014
*nix have pipes, Elixir has pipes, Ruby deserves pipes! I just hacked this together yesterday and I'd love to get some feedback:

pipable("moo") | Reverse | Leet | Mooify | :downcase |'@pcreux') | { delete: 'o' }
# => cw said: 00m
Blog post announcing Hangar, the Rails plugin we made at Faraday to expose factories to our Protractor tests.
Harry's is open-sourcing Kontrast, an automated testing tool for comparing visual differences between two versions of a website.
Advanced gsub
Today I'm celebrating the two-year anniversary of RubyTapas today, and in honor of that I've freed up a short screencast about an advanced usage of String#gsub from the archives.
Want to get started with Docker for hosting your Rails apps? There are a lot of options out there. In this post I describe a start to deploy a Rails app with Docker.
Should my company choose RubyMotion or Swift?
We've been writing a few Swift apps at TFG. Here's a summary of our experience shifting from RubyMotion .
September 23, 2014
Use RSpec and JSON Schema to create a test-driven process in which changes to the structure of your JSON API drive the implementation of new features.
Can you learn Rails before learning Ruby? You can, for a little while. But if you want to learn enough Ruby to master Rails, study Ruby on its own. There are tons of Ruby books out there. I counted four shelves the last time I was in a bookstore. A lot of them are good. But there are a few that are in a class of their own. And they'll help you through the entire process of picking up Ruby.
Dancing drones, Gangam Style, Matz, sun and the nicest-looking presentation ever, in other words: Sunny Memories from the Barcelona Ruby Conference 2014 .
Do you find yourself too lazy to go to translation file to create a new translation entry? Are your views full of "I'll turn this in to a translation call later" literal strings?. Well, end to your woes is a click away. Check out the new version of Burek!