RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 
November 24, 2014
I just wrote a post, how to cache database queries in memcache to boost up your application performance Read the post here and please give feedback
I've released tty-screen to allow for cross platform screen size detection. This is another component for tty.
November 23, 2014
Flip Flop Operator in Ruby  nithinbekal.com
The flip flop operator is one of those weird features of Ruby that most people aren’t even aware of. It’s one of the many Perlisms that sneaked into Ruby, but hasn’t caught on. In this post, we will look at what flip-flop operators are, and where you can use them.
Just published ApiView as a performance focused serializer with a slim and lean code base.

The difference between ActiveModelSerializer can be up to 10x faster JSON response, not something to sneeze upon!
Please checkout and enjoy!
ComfortableMexicanSofa Rails 4 CMS Engine version bump.

See Release Notes for details
November 22, 2014
Pastel v0.4.0  rubygems.org
Pastel allows now for detaching common style combinations, as well as for nesting of styled strings by using blocks. Please give it a try and let me know what you think!
The 1.0 release of Clean Ruby is here!
Anyone who bought it has received a new download link, but I wrote a bit about my experience and what people have to say.
I was displeased with any of the (yet so many) libraries for generating colored console output, so I wrote my own: hansi.

Features:

8 color, 16 color, 88 color, 256 color and 24 bit (True Color) mode
converts colors between modes
proper color nesting (this is broken in highline, which is what I'm using in most of my projects right now)
automatically detect proper mode for current terminal
does not come with a Ruby DSL
supports string templates (optional)
supports themes (optional)
zero dependencies
full test coverage
no monkey patches
November 21, 2014
I wrote a new post about forwarding messages to an object that might be nil and what to do with your code.
Raptor is a cool new app server that's up to 4x faster than Unicorn, up to 2x faster than Puma, Torquebox. This second article describes many techniques that has made Raptor so fast. It's the second part of a blog series on Raptor performance optimization.
November 20, 2014
Generating Descriptive Statistics in Ruby and Rails. The core Ruby libraries do not provide an easy way to calculate simple descriptive statistics on collections of numbers. However, this can be easily achieved using the DescriptiveStatistics Gem.
Unicorn Unix Magic Tricks  thorstenball.com
I just published the blog post version of my talk Unicorn Unix Magic Tricks. It looks at how the Unicorn webserver works in great detail and explains the underlying Unix concepts which it uses to leverage the power of the operating system. It's a really detailed (and long) blog post that shows how forking, system calls, signal handling, pipes and Unicorns master-worker architecture work.
RubyGems started with a single marshaled file called Marshal.4.8.gz containing the array of every Gem::Specification object for every gem that has been uploaded to RubyGems directory. Since then we have new indexes for RubyGems to speed things up, but good old Marshal.4.8.gz is still around carrying important information about gems from RubyGems.org. Are you interested to know what is and what is not there and finally understand why gem specification rails -r does not give you the information on licensing even though it’s part of rails’ gemspec file? Read more
Using service objects as replacement of strong params makes controller validation easy and complete. Check our gem here: ParamsFor. Thx and happy coding.
November 19, 2014
Cache-Control directives are pretty straightforward to understand. They're easy to use as well if you assume that all the caches between your end user and application correctly implement the spec. Unfortunately, as with any spec, you can't make that assumption. You need to be aware of any spec misinterpretations in the implementation of the caches that you're using, and properly account for them. Learn How to Get Cache-Control Right
In a recent episode of the RubyRogues podcast, Martin Fowler and Jessica Kerr illustrated Healthy Codebase and Preparatory Refactoring with beautiful words and powerful metaphors. I share those in this article.
Ruby is a great programming language to write DSLs - unfortunately often developers monkeypatch Object to define top level scope methods. There is a better way that does not pollute Object with unnecessary methods.
Refactoring - WHY? opens a short series of blogposts answers the “why”, “how” and “when” of code refactoring.
I wrote a new post on Creating Rails Active Record Validation Contexts with Inheritance. Hope you enjoy!
Sublayouts in Rails in 3 easy steps.
November 18, 2014
If you don’t know the difference between the various Ruby and Rails consoles, you’ll have some problems. Maybe you’ll require a file and get the wrong version. Or a library you thought would be avaliable, wasn’t. So how do you make sure you’re using the right console at the right time?
How to get your app running on the SAP HANA cloud platform.
November 17, 2014
Do you hate fixtures? I do as well.

VCR is a good library for stubbing HTTP interactions, but it is very difficult to maintain dozen cassettes in the project. If you feel the same and you want spend less time on understanding what is wrong with your cassettes, you may find this article useful. Let me know what your thoughts are about that.
Typekit, web.typography.com, and other font services or external APIs can slow down your JavaScript integration tests. Speed up your tests with this setting.
ReadActivity supports model to track read/unread status for a specific time, like 'Seen by 99' on Facebook. Please check out my GitHub.
Last week, we released the activerecord_sane_schema_dumper gem (extracted from an initializer we’ve been using for months) in order to generate a clean db/schema.rb file with Rails. It strips useless (and harmful) alignment whitespace from the file so changes to your DB columns doesn’t affect irrelevant lines.
Build a Ruby Gem is 25% off until the end of RubyConf. Hope you enjoy!
Today I'm Open-sourcing Aloo - my Rails Rumble 2014 submission. Aloo is GIST for data - uses Rails and Redis.
I've just released a new version of stream-rails. A gem to create activity feeds and newsfeeds with Ruby on Rails. The gem comes with a very basic example app that you can deploy to Heroku.
November 16, 2014
finite_machine gets better with alias_target method and log_transitions option. Please see documentation for full interface.
The last post in the intro series on Rubinius 3.0 talks about some exciting changes to the language.
November 15, 2014
I'm an avid user of Forwardable from Ruby's standard library. My latest article explains why you can make shorter, simpler code with Forwardable and hide the noise of boilerplate Ruby code.
I just released tty-spinner for drawing spinning animations in terminal emulators.
November 14, 2014
Here Brian introduces the subsystems of Rubinius: GC, JIT, Metric, UI, and CodeDB.
Clojure Loops in Ruby  sitepoint.com
An article that builds Clojure style loops in Ruby using continuations. Not recommended for pregnant women or individuals with pre-existing heart conditions.
Action Access is an access control system for Rails that provides a modular and easy way to secure applications and handle permissions. It works at controller level focusing on what actions are accessible for the current user instead of messing with models and their attributes. Read more »
Using spring with pow!  dev.mikamai.com
The other day I was a bit sad for I was aware that pow (the web server) wasn’t leveraging spring (the Rails preloader) with its fast load times. Read more »
I just launched a new gem named Scribble.

Scribble is a client facing template language similar to Liquid. Scribble was written in Ruby and can be used in any Ruby or Ruby on Rails project. It takes a template file, consisting of text and Scribble tags and transforms it into text. Scribble can be used to transform any plain text format like HTML, Markdown, JSON, XML or plain text. Client facing means that it is safe to use Scribble to run/evaluate user provided templates.
Check out Hemant Kumar's post about preventing MySQL deadlocks in Rails...
Sometimes you need to save a SQL query or query parameters for the future use. Here's a flexible solution allowing you to save & use it every week.
Sometimes you need to save a SQL query or query parameters for the future use. Here's a flexible solution that allows you to save it and reuse every week
Maxitext
- Ctrl+c stops tests and prints failures
- pastable rerun snippet for failures
- multiple before & after blocks
- around blocks around { |t| Dir.chdir(...) { t.call } }
- red-green output
- mtest executable to run by line number and by folder
and more goodies :)
November 13, 2014
Checkout the v0.3.0 changelog of themes_on_rails .
Look over our shoulder as we refactor and optimize a set of queries.
Starting to dive a bit deeper about improvements in the Rubinius instruction set.
Interesting thoughts and some welcome improvements planned for Rubinius 3.0.
One of my first tasks as NY Tech Meetup’s newly minted hacker-in-residence was migrating our application from Heroku to Ninefold. Scary! Or at least it sounded like it would be. But it turned out to be a pretty straightforward and painless process. Here’s what you do...
November 12, 2014
I just launched Services - A nifty service layer for your Rails app and blogged about it. Let me know what you think!
Over last couple of months, our team has helped further develop a unique video distribution platform. Finally, the big launch day has come and we’d love to introduce you to Uscreen: here's a little cast study about the platform.
Ru brings Ruby's expressiveness, cleanliness, and readability to the command line. It lets you avoid looking up pesky options in man pages and Googling how to write a transformation in bash that would take you approximately 1s to write in Ruby.

For example, to center a file's lines, use: ru 'map(:center, 80)' myfile.