RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
April 07, 2014
Both AutoLayout and the creation of custom UITableViewCell subclasses is extremely important when doing iOS development, so once you've finished watching this episode, I'd like you to take away the knowledge of "Why is AutoLayout important?", "Why create custom table view cells?", "How AutoLayout works", and finally "How to use AutoLayout when creating custom cells". You're going to learn these things while we take a look at our example RubyMotion application "Tasker", and there is some new parts to MotionInMotion in this episode where I change up the format a little, with a bit more "Why" than just how, as well as a challenge for you at the end to practice your skills.
April 06, 2014
Every developer has to deal with technical debt sooner or later, here's how I deal with it.
Workflow Gem Explained
A look into the internals of Workflow and how it enables an easy interface to create a state machine. Check it out.
April 05, 2014
TheSotrableTree is popular render-helper for AwesomeNestedSet trees. The Magick of this gem in simplicity of implementation. Gem used recursive function to render tree. But recursion is very slow when tree contain more then 100 items. This problem solved with index-hash. Yesterday I patched this index-hash, because I found logic mistake. Previous versions should works fine, but current version more stable. Please, read release note to know more.
April 04, 2014
Partial caching is a great way to get some major page speed improvements without a lot of work. But if you forget a touch: true on one of your associations, or your template dependencies aren’t working right, your cached partials won’t get updated. Rails' development environment usually runs with caching disabled, so you'll need a simple way of enabling caching temporarily to investigate and reproduce your caching bugs.
I wrote second part of tutorial about how to create todo list app in rails
Array is so common in Ruby and well done (especially as a litteral) that it's usually the first choice as a collection. But sometimes we need to avoid duplicates, and we end to duplicate a lot of checks to do that. The post explains that use case and suggests a solution..
RubyMine 6.3 is Out!
RubyMine 6.3 is finally ready with Rails 4.1, Slim 2.0, AngularJS, and much more on board. More details.
April 03, 2014
Want to create a good looking presentation without using Powerpoint or Keynote? Would you like to use your favorite editor and Ruby, instead?

I've been using reveal-ck to create presentations for the past year, and I just finished three screencasts that explain the process.

If you've heard of reveal.js, reveal-ck is a gem that generates reveal.js presentations-- and it lets you author content in various languages: markdown, haml, slim, and textile.

See the screencasts here:

I've been using more docopt.rb for the past 18 months as our CLI option parser and I think it's awesome. I've written a post about it here.

Hopefully it will encourage you to take a look at it.

Keep Your Secrets Secret
Take control of your Rails app's configuration and keep your secrets secret.
Help fund Rails Girls Summer of Code 2014!
Rails Girls Summer of Code offers three-months full time scholarships to programming newcomers. We aim to support 20 students (10 teams) to work full-time, expanding their knowledge and coding skills by/while contributing to a great Open Source project. Last year's Summer of Code has been a raging success. This year we will make it happen again with your help!
My name is Daniel Trierweiler and I work for a german digital advertising agency. We have developed a library in order to integrate Magnolia CMS within a Ruby on Rails application using a document based HTTP API.

We are using this approach for most of our customers' websites and we have decided to open-source the gems. Therefore we are going to host a webinar about the integration on April 17th, 5:00 pm - 6:00 pm. It will demonstrate how to access Magnolia CMS content from a Rails project, and highlight common challenges and best practices for the integration.

Currently the project is still closed source. We are executing the last steps of open-sourcing the gems and they will be available for the webinar as rubygems and on github.

More details can be found at (registration to the webinar is free!)

Please feel free to email me if you have further questions.
I just wrote an article about how to subclass the default form builder to create complex and structured forms.

This technique allows you to keep your views really light on ruby code and delegate all the complex stuff to a ruby class that is a descendant of ActionView::Helpers::FormBuilder.

You can read it on my blog
In May 31 - June 1 Kiev will host the second RubyC conference, dedicated to Ruby and Ruby on Rails

This year RubyC gathers a star cast of speakers from America, Europe and CIS countries. Among many: Steve Klabnik (USA), Ben Lovell (Great Britain), Javier Ramirez (UK), Alexandre de Oliveira (Brazil), David Henner (USA), Jeremy Evans (USA), Konstantin Tennhard (Germany), as well as Bogdan Gusev (Ukraine), Timothy Tsvetkov (Russia ) , Evgeny Pirogov (Russia).

More information about the speakers and their topics can be found at

Useful info:
• Ticket sales now open on the conference website!
• Venue: BC "INCOM" str. Smolenskaya, 31-33, Kiev.
• Working languages - English, Russian and Ukrainian.
• Join groups RubyC on Twitter and Facebook.

Hope to meet at RubyC 2014!
Surviving APIs with Rails - Code School
Code School just launched a new course covering how to build and test REST APIs with Rails. The first level of the course is free, if you're interested in checking it out.
April 02, 2014
I've just launched a 4 days FREE email course about Rake. If you are interested please sign up on this page: The 4 days Rake Guide.
Remember the last time you accidentally checked in a gigantic file you didn’t mean to, and had to dig through the Git history for it? And everybody had to update their history and that one guy accidentally blew away all his changes?

Ah, Git . It’s a useful and powerful tool, but it’s also easy to make mistakes that can be a pain to recover from. What if you could avoid some of that pain before you commit your changes?

Over the past year, we have started using Git for some of our projects here at OnLive. As part of that process, we found the need for tools to help prevent mistakes we didn’t want to accidentally make – like checking in giant files, or forgetting to include a bug ticket number in the commit message.

(Article by Ruth Helfinstein, on the OnLive engineering blog.)
I just posted Preview emails for any user with Rails 4.1, explaining how to have a custom ActionMailer preview for every user of your system.
Good to know how Ruby compares Time
Paginating database results is a standard feature of most web applications, yet isn’t something you’d want to necessarily implement on your own. Fortunately, Rails developers have a whole host of options at their disposal, including the will_paginate gem. This post shows you how to easily integrate will_paginate into your Rails application. Read the post.
April 01, 2014
I just updated the zucker core extension library and it is now completely based on refinements. It is organized in very small units and playing around with it is a great way to get familiar with Ruby's new refinements!
I'm excited to announce that our full speaker lineup is now on our website! We have 13 awesome speakers joining us this August 2nd & 3rd for a unique, single track conference on the shores of beautiful Lake Champlain in Burlington, Vermont.

If you weren't able to attend last year, many people have said that it was their favorite regional conference of 2013, and we hope to make this year even better. We also have a limited number of early bird tickets on sale now that will only be available until April 15th.

Hope to see you this summer!
TL;DR: test quality is not just about verifying correctly whether your code works, it’s also about making your test easy to read and understand.

This post talks about improving your tests quality by making them more readable. It teaches you how to do that using the xUnit four-phase test structure standard.
I just launched an early version of Fourchette and would love if you could try it. What is Fourchette? If you use Heroku and GitHub, look at my post...
I just posted a small (rant-ish) post for Rubygems author, mainly! ;)
In this episode we will use TDD to write a custom JSON serializer using ActiveModel::Serializers. We’ll learn about how to use scope to determine which attributes to serialize. We’ll also look at some of the changes in the forth coming 0.9.0 release, including breaking changes around using URL helpers in a serializer.

* Subscription required.
The macros4cuke gem, is a Cucumber extension that allows you to define your own custom steps without programming has reached version 0.5. Give it a try: its installation is simpler than ever...
You know what you want to do, but your code just isn't cooperating. Maybe it has a few too many levels of indentation, or chains a half dozen methods, or looks asymmetrical. Whatever it is, something just feels off. You could ignore it -- I mean, you have a backlog full of features you still want to write, and it's really not that bad. But that would be a mistake: Your code is trying to tell you something, and you don't want to miss it.
Code School launched a Rails API course covering how to build and test REST APIs.
The attr_accessible macro has long been a Rails mainstay, playing a major role in preventing malicious access of sensitive model attributes. However it (and its sibling attr_protected) was deprecated in Rails 4 in preference of a new approach known as "strong parameters". In the latest Easy Active Record blog entry I introduce strong parameters, explaining why attr_accessible was inconvenient and demonstrating the advantages gained by the new strong parameters approach.
better_helpers is a rubygem that provides a simple pattern to keep your helpers scoped, avoiding conflicts in the global namespace.
Make Your Life Easier With The Open Source Gem for Dokku (Dokku Client for rails project with preinstalled dokku plugins.)
On Sunday, I released a small side-project of mine, a gem called tco. It's a tool to simplify colouring things in the terminal. The main feature of it is the way it works with colours. Instead of an oddly organised sequence of colour codes, tco simply works with RGB. It provides a library for your Ruby gems and apps, and also a standalone command-line tool that you can use anywhere else.

It’s available on RubyGems, the sources are hosted on GitHub (licensed under MIT), and this blog post explains how to use it.
Today we're announcing Heroku Subletting. A great new way to share the cost and resources of multiple Heroku Performance Dynos.

Read more about Heroku Subletting
You can already mirror github so why not Heroku, too?
March 31, 2014
Just over year after launching I took a look at some of the more interesting stats on Episodes.

If you're curious, here are the results.
iOS on Rails is a book for anyone with some Rails experience and little or no iOS experience.

After reading iOS on Rails, you will be able to create a JSON API with Rails and an iOS app that interacts with that API.

The book covers:

* Which tools we chose for rendering JSON endpoints and why
* How to test-drive development of your Rails JSON API
* How to create JSON endpoints for GET, POST, and PATCH requests
* How to create geocoded API endpoints
* How to set up your first iOS app in Xcode
* How to consume and use API endpoints in an iOS app
MagmaConf 2014 takes place this June 4, 5 and 6 in beautiful Manzanillo, Mexico; and our Early Bird discount tickets are going fast! Don't miss out on your chance to attend Mexico's premier web development conference. We've got some great speakers lined up including Sandi Metz, Desi McAdam, and Fred George (check out the full line up here). We've also got your amazing beach side room all made up just for you, so make sure to book your room at Magma Village before it's too late!
Boston's 2nd annual Ruby Conference's RFP is open. We are also looking for sponsors.
A lot of folks wonder, “how do you deploy Ruby in a commercial environment with strong stability requirements?”

But even more wonder, “how the @#$@# do you get Ruby to STOP COMPILING RUBY AND NATIVE GEMS ON EVERY MACHINE?”

We’ve answered both questions at OnLive. See if you like our method!
ITTIA DB SQL now provides Android applications new capabilities to discover nearby data from other devices such as mobile tablets, notebooks, and embedded systems. With a footprint suitable for embedded systems, interoperability is greatly simplified, and new data is automatically and efficiently transferred upon discovery, so that Android applications can monitor and control nearby systems.
Feeling lost among your unorganized and bloated CSS files? Check out how we're managing it in our new blog post. Written by Bruno Azevedo: Our CSS/Sass Project Architecture and Styleguide.
48 links to follow up on from CocoaConf
If you couldn't get to CocoaConf, or didn't take very good notes, Ara rounded up 48 links to resources and events mentioned while he was there.
RestKit is an amazing library for communicating efficiently and easily with RESTful services, like a Rails backend for your application. With a bit of setup, it's by far one of the best ways to keep your RubyMotion app in sync with your server. We're going to continue where we left off in Episode 16 with our Tasker application, and have RestKit keep our tasks saved to the server, and keep the server and Core Data store in sync. See the show notes for the Rails app I'm using with Tasker.
March 30, 2014
The finite_machine has stronger focus on event driven transitions. Now you can call your events asynchronously fsm.async.go. Please check it out and let me know what you think!
Omega - v0.7.2 release
We are pleased to announce the v0.7.2 release of the Omega Simulation Framework. The release has been cut and tagged on github and deployed to the Omegaverse node.

This release brings many new features including performance optimizations, particularly around the WebGL frontend, improved graphics, new server-side subsystem events and JSON-RPC API methods, and much more. Also recently added is a new cutscene rendered using the Omega web frontend.

You can view the complete changelog here

Be sure to follow the repo and join our chat channel and mailing list to keep up with updates. Until next time, happy hacking!
Prefer The Declarative Over The Imperative

This article was spawned in response to a comment on Pat Shaughnessy's awesome article Use An Ask, Dont Tell Policy With Ruby asking about TDDing the example

read more
Timecop Gem Explained
Post on how Timecop works and how it extends Ruby classes.
March 29, 2014

ruby test/unit/alert_test.rb
... Failures as normal ...

ruby test/unit/alert_test.rb -n 'AlertTest#test: Alert raises on first

23 tests, 25 assertions, 2 failures, 0 errors, 0 skips
gem install minitest-rerun
require 'minitest/rerun'