RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 
March 27, 2014
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.
I have been putting these posts together for all programming languages, at least those who're supportive of web frameworks, first I'm on a mission to cover all of the minimal ones - then move on to bigger guns!

Here is the link.
Many times, we feel we should use gems to solve our problems. I believe gems should be a last resort in many cases since Rails already have most of the API to solve the problems you need.

Read my thoughts on the matter here
Last week, I talked about three conventions that can help you beat procrastination and get your new Rails project started. But you still have a tough choice to make. Which code do you write first? Authentication? The part that talks to Twilio? And how would you even begin to work on the forum post recommender engine? Yep, at some point you actually have to write the code, and to do that, you need a place to start.
12 Vim Tips  dalibornasevic.com
Compilation of 12 Vim Tips I've found interesting.
Here's a story about using some of Ruby's powerful command line options to refactor a large-ish script to (essentially) a one-liner. Read Using Ruby command line options.
Form object validations in Rails 4  crypt.codemancers.com
We have written a blog post about how to write, and validate form objects here. Examples in the blog don't use any gems, and just use services provided by ActiveModel::Model to implement form objects.
Curious How to Build a Rails Engine?. This post will walk you through the process of creating a Rails Engine for a client-side timestamp gem. Enjoy!
I wrote first part of series of posts about how to create todo rails app
BigBroda is an ActiveRecord adapter for Google Bigquery.
It supports many of the AR awesomeness: querying, associations, migrations and yadayada
March 24, 2014
OrderTrk.com is a site which organize your orders across the net. Inside you'll find a wall with your orders and a convenient interface to view the order details on desktop, tablet & mobile (Foundation). You can send your PayPal receipts by mail and the orders in it will be automatically inserted to your account (for more details see the News section). Nice & Easy. Support for more sites is planned (e.g. Amazon) and further options that will make your life easier!
The site is built with Ruby on Rails and i would like to hear feedback from you and suggestions for improvements.
HOPE YOU'LL ENJOY IT!
Manage Your Child Labor with Ruby!  engineering.onlive.com
Want to write a server with multiple concurrent child processes in Ruby, for maximum safety in failure? Here's how to do it in Ruby, how to handle restarting workers and shutting down the process, limiting resources and even when to hand off to an external process manager.
A new article is up @ rubylove.io!

A Functional OO Deck of Cards..
Let's build a deck of cards today using a hybrid approach, that is to say, lets use good Object Oriented design but keep our objects stateless and our functions idempotent.

We are going to need to describe a deck of cards using objects, so let's look for some logical boundaries and give them names. One way we can do this by describing what we want in a paragraph and a title. Let's do that now!

Continue reading A Faux-O Deck of Cards at rubylove.io
Introducing Lotus::View  mustache.github.io
The missing part of all the Ruby web frameworks is the distinction between views and templates.

Keeping things separated, helps to declutter templates and models from presentation logic. Also, since views are objects they are easily testable. If you ever used Mustache, you are already aware of the advantages.

Lotus::View is based on these simple concepts.
[Continue reading]
Nothing fancy, just simple word/tag based recommendation algorithm written in Ruby.
I posted an update about the packages available for my Build a Ruby Gem eBook. The book will be available starting Thursday, March 27th at Midnight (EDT).
It's time to learn how to efficiently manage a Core Data backed UITableView by using NSFetchedResultsController. It's much simpler than you would think, and once it's done it's extremely easy to maintain. Your table views will be faster, your memory usage will go down, it's just a great time to be a table view!

https://motioninmotion.tv/screencasts/16
March 23, 2014
wroclove.rb 2014 recap  adamniedzielski.github.io
What are the hot topics in Ruby community? Read what was discussed at wroclove.rb 2014 conference
synvert is a very interesting project we are working on now, it can parse your ruby source code, find out old deprecated ruby code and then automatically replace them with new better syntax ruby code according to predefined rules.

We already define 4 snippets (predefined rules),

1. use FactoryGirl short syntax, e.g. replace FactoryGirl.create(:post) with create(:post)
2. convert dynamic finders, e.g. replace User.find_all_by_login_and_active('name', true) with User.where(login: 'name', active: true)
3. use strong_parameters, remove attr_accessible in models and add def xxx_params; end in controllers
4. automatically upgrade rails 3.2 to rails 4.0

synvert is still in alpha stage, any suggestions or pull requests are welcome.
JODY is a technique which uses JSON and conventions to simplify development of sites with dynamic content.
March 22, 2014
Using Extract Method Object to refactor large methods

I have previously been over the extraction pattern, Extract Method. Today we will explore it's big brother, Extract Method Object.

The Extract Method Object pattern is used to take a method or groups of methods from coupled, untestable code into code that adheres to the Single Responsibility Principle, or an object/ method/construct should have 1 and only 1 reason to change.

Read now!
Hello, I've updated the worlddb gem that includes models for places, continent, countries, regions, cities and more. The worlddb gem also includes free open public domain plain text fixtures for all countries and territories in the world plus some regions/states/provinces and some cities/towns/hamlets. Use it like c = City.find_by(key: 'wien'); c.country.name # => 'Austria' and so on. Cheers.
March 21, 2014
Step by step guide for deploying Rails Application to OpenShift PaaS
http://blog.sudobits.com/2014/03/22/deploying-ruby-on-rails-application-to-openshift-paas/
At OnLive, we open-sourced an experimental Ruby HTTP framework with some ideas I think everyone should steal.

Basically: dual-mode SOA where you can debug as a single process and break into multiple processes for testing and deployment.

The framework works fine, even though it never made it into the final product we hoped.
Join us Oct 11 - 12 for Boston's 2nd annual Ruby conference. Please note this is a evening conference. We have pre-launch tickets available. Limited quantity of 50.
We recently had to create a spotlight search like feature using Elasticsearch in a rails app. You can read about it on our latest post.
C macros are used fairly often in Objective-C projects, but RubyMotion doesn't provide a solution for these. Instead we can preprocess our application's files ourselves before they're compiled, using ruby!

http://blog.motioninmotion.tv/rubymotion-preprocessor-code
A new blog post in the code climate blog named Kickstart your next project with a Walking Skeleton.
I just wrote a post about how to Create Install and Deploy a Ruby on Rails App in Five Minutes. Using open source force you can easily create your own websites.
Validate HTML locally in your integration tests. No more dependencies on a third party service. Run faster. Improve your search ranking (google CARES about valid html!) Know when you make an HTML mistake. html_validation wraps the HTML Tidy executable by the W3C, and supports HTML 5.

New in version 1.1, you can specify validation errors to globally ignore, attributes to ignore, and tags to ignore. Because sometimes you need to break the rules...
March 20, 2014
My follow-up post on Ruby blocks is up at the O'Reilly Programming blog: Why Ruby Blocks Exist: Putting Return Values to Work. Learn how map and find_all work behind the scenes!
Effective business communication heightens productivity. An important step in increasing communication and decreasing inefficiencies is to eliminate assumptions.

By iterating with the business using Behavior Driven Development tools like Cucumber, we’re able to account for discrepancies in interpretations and speed up the development process over the long term while allowing changing requirements from the business.

How to Improve Business Communication with Behavior Driven Development
March 19, 2014
Steel City Ruby CFP Opens  cfp.steelcityruby.org
The CFP for Steel City Ruby 2014 is now open at cfp.steelcityruby.org and will be open until April 19th, 2014.
The fourth iteration of eurucamp will take place on 1 - 3 August 2014. Our Call for Proposals is open until the 1 May and we're launching a mentorship programme to help encourage new speakers to participate.