The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Screencast: Ruby's Socket API From the Outside In
In this screencast I show a really high level wrapper that Ruby provides for making TCP servers. I take 3 lines of high level code and break them down into 25 lines of lower level code. The pretty 3-liner won’t work in all cases, so I walk you through the layers of abstractions until we go as low as we can (in Ruby).
Phusion Passenger 4.0 beta 1 is here
Multiple Ruby versions, evented I/O, real-time response buffering, Python WSGI support and much more.
Check for empty fields in your database
If you work on a project that is quite old and you haven’t looked in database schema yet it is time to clean up the garbage! See all empty columns with this simple ruby script.
Deploying to Heroku from TravisCI
Travis CI and Heroku are two of my favorite tools. Recently I tried to figure out if there was an easy way to have Travis automatically deploy to Heroku once the tests have passed. Turns out it’s incredibly easy!
Progress Bars for Ruby's CSV
A small module to easily add a progress bar to Ruby’s built-in CSV library. It uses the progress_bar gem to do all the hard work.
Remove 404.html, 422.html, etc from public dir. Render errors in your layout
Taking advantage of the new “exception_app” functionality in Rails 3.2 better_exception_app provides a easy way to help you delete 404.html, 422.html and 500.html from you public directory. Error messages are rendered dynamically in your layout. No more copy/pasting, no more jarring white screen. If desired, keep certain errors static for safety (i.e. 500.html). Includes a generator to make it easy to keep the look of your static errors in sync with the rest of your site.
Try mruby Today
Want to check out that mruby thing everyone has been talking about, well guess what you can try mruby today. Also a great introduction to building binaries (hint: if you don’t know what that means, you should read this article).
Substance Document, an open standard for digital documents
Substance Document helps with the creation and transformation of digital documents. It ensures consistency, separates content from presentation and provides an easy to use API. It depicts the heart of the Substance Platform, a set of tools for content creation and distribution.
Be proud of your website error pages
Conscious Ruby on Rails development team at Idyllic Software just launched Proud Errors. The application turns your rails application error pages to show a global cause. No need to design for error pages any more while you can now be proud when that 404 or 500 page shows up. [more inside]
JRuby 1.7 Released
I just saw that the JRuby team released version 1.7. Looks like lots of patches and bugfixes, plus it defaults to Ruby 1.9.3 compatibility and supports Java 7+ invoke dynamic feature.
Lightweight API Services with Padrino and RABL
On the Crowd Interactive blog, Fernando Castellanos posted an excellent step-by-step guide for building lightweight API services using Sinatra, Padrino and RABL. If you are interested in a lighter and faster way to describe and create APIs with complex JSON responses using Ruby, be sure to check this post out.
ITTIA DB SQL 5.5 Integrates with Many Popular Development Frameworks
The new ITTIA DB SQL 5.5 offers the most complete embedded data management experience, including high reliability, comprehensive security options, Qt user interface integration, Python and Lua scripting, JDBC compatibility, and replication. Embedded devices can also synchronize their local databases with Microsoft(R) SQL Server(R) and Oracle(R) on Windows and Linux servers. Evaluation copies are available at: http://www.ittia.com/products/evaluation
Ruby Installer for Windows updated
RubyInstaller just updated their Windows installers for Ruby 1.9.3p286.
YAML Support and Hash Representer In representable-1.2.7!
The representable gem got YAML support with flow-style lists, a hash representer for using forms and more. Where? Here!
nginx + unicorn + performance tweaks + Amazon EC2 t1.micro
Step-by-step nginx configuration with unicorn support, which runs on Amazon EC2 t1.micro.
Rating capability for your Rails3 applications.
The new letsrate gem is the only rating gem working in Rails3 that works without any hack.
RedStorm 0.6.4, JRuby integration & DSL for the Storm distributed realtime computation system
RedStorm v0.6.4, the JRuby integration & DSL for the Storm distributed realtime computation system, has been released to Rubygems. It includes Storm 0.8.1 and JRuby 1.6.8 compatibility.
Version your Ruby objects with Aversion
I just wrote a a post about Aversion, my new library to make versionable Ruby objects :)
A Common Gotcha When Using Ruby Regexps For Input Validation
Ruby’s regular expressions have an idiosyncrasy around end-of-line and end-of-string anchors that can get you in trouble when doing input validation. Find out how and why to avoid it in this brief post.
An eCommerce Refactor: Cleaning up a Common Pattern in a Rails eCommerce App
Check out this article about eCommerce and Rails http://www.engineyard.com/blog/2012/ecommerce-rails/
New Gem: Literate Randomizer
I wanted an easy way to generate good, random, near-english prose. There wasn’t a gem that made me happy, so I wrote a new one: Introducing literate_randomizer. (my blog post) [more inside]
Rails Caching: A problem with etags and a solution
I just published a gem to help with busting Rails http caching when you deploy your application.
Forward, formally Showoff, is live.
Forward lets you share something running on localhost with someone across the web. [more inside]
Rails callbacks and boolean values
Ever get caught out by a seemingly silent error causing your transactions to rollback? you could be falling victim to rails callbacks cancelling when you return a falsey value. It will catch you out at least once in your Rails career.
If you're not tracking exceptions with Errbit, you're probably doing it wrong
I’ve put together a shortish blog on our journey from Exception Notification through flotsam up to Errbit. If you have a medium-to-large Rails app and your code ever has errors, this post is for you.