RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
April 01, 2014
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'
I wrote a short blog post on how to crash many Rails/Rack based apps. Not a big deal and not a security issue, but still worth patching: Rack: ArgumentError: invalid byte sequence in UTF-8
ruby on rails installation guide
I made a post about how to install rails
March 28, 2014
We have an extremely exciting announcement to make: Brace Yourselves, RubyConf Portugal is coming!. Check it out.
Sidekiq 3.0 now available
If you run background jobs, good news! Sidekiq 3.0 is now available.
Learning resources for ruby
I wrote post about learning resources for ruby
7 slow and painful deaths by regexp
Most of the Lotus frameworks was released in the past months.
The main Lotus gem isn't out yet.

This gist has a simplified version of Lotus, and it shows how to build a full stack application today.
March 27, 2014
zihin acan dualar
Hafıza duaları zihin acan dualar hafıza gelistiren ve zihin acan dualar
The MotionInMotion RubyMotion pairing sessions are focused on doing one-on-one training with developers who are new to RubyMotion, and recording them so other newcomers can learn from it. In this session we work through an error when working with cocoapods due to Command Line Tools not being setup, and then go through some of the basic concepts of iOS development like views, target-action, table views, and delegates & data sources. If you're not interested in the part at the beginning where we're fixing the error in cocoapods, skip ahead to 22m 20s in.
islamda cinsellik
On the OnLive engineering blog: TurboLinks: the Best Thing You Won't Ever Use in Rails 4.
Great article by Michael Guterl Structuring CSS On The Filesystem good article for anybody who works with CSS, but especially applicable to Rails developers.
If you're headed to CocoaConf this weekend, but can't decide which sessions to see, check out these 7 sessions picked by @tvon.
I just released a gem called abracadabra and it makes injecting forms with text boxes super easy.
Tired of Ruby's modules not allowing you to mix in class methods easily? Tired of writing complex code and using complex libraries like ActiveSupport::Concern to accomplish that goal?

Well, worry no more! SuperModule comes to the rescue!!

SuperModule allows defining class methods and method invocations the same way a super class does without using def included(base).

This succeeds ActiveSupport::Concern by offering lighter syntax and simpler module dependency support.

Read the full article here.
Many applications require the retrieval of random database records (for instance to highlight a random product in an online store). There are several ways to accomplish this task, but efficiency varies widely and becomes more pronounced as your database grows in size. This blog post demonstrates two common approaches when using Rails Active Record and MySQL, and benchmarks both (using the Ruby Benchmark module) to demonstrate their efficiency.
Check out my blog post How to tune a guitar with Ruby.

There are code examples for using FFT, Gnuplot and some beautiful plots.
The Build a Ruby Gem Ebook and Screencast packages are now for sale. Hope you enjoy!
Moore's law is over. Modern computation is exploited by running processes on multiple cores.

Ruby has always ignored this trend, and the community didn't put enough attention on this topic.

The VM allocates a memory heap, which is shared and writable by threads. If incorrectly coordinated, those threads can lead to unexpected behaviors.

[Continue reading]
Running Thin in a Thread to serve static files (or how to seed carrierwave images) - code snippits and words describing how to upload images using carrierwave from the commandline.
The 5th edition of the conference was a roaring success. Read about it here.
March 26, 2014
Actually, it's likely not any slower for mobile clients: don't confuse relative performance with absolute (latency) savings. Confused? Read on...
I've written a review of a couple great Rails books.

Summary: If you're an absolute beginner with Rails, then Learn Ruby on Rails would be the book for you. If you already have a few Rails apps under your belt, and you want to see how flexible and extensible Rails really is, then you should take a look at Crafting Rails 4 Applications.
In the runup to the publication of my new book, "Easy Active Record for Rails Developers", I'm publishing a series of posts covering commonly confusing or little-used Active Record features. The latest discusses two approaches to creating default Active Record model attribute values.
Want to know how to read a single character in a non-blocking, buffered, cross-platform way in Ruby? I just got you covered in my new blog post.
Hope this will help many.
March 25, 2014
Check out my recent post about how to skip active record callbacks in tests.
Hi Lexeme users,

I have updated Lexeme gem to version 0.0.5

Lexeme on Github
Lexeme on Rubygems

One tiny thing I added is the line number where token is found - useful for hinting errors to the user.

Please check it out and let me know if there is any other feature requests.
I just launched a revised beta version of Maths practice app for 6 to 10 year olds (May be even for adults !). Please check it out.