The Blog: Ruby
2011 Open Source Projects
Oh right, it’s 2012. Better late than never. In addition to the numerous contributions we make to existing open source projects, we also find the time to release libraries or projects that we extract from our applications. In 2011, those 22 projects were:
- leaderboard – https://github.com/agoragames/leaderboard - Leaderboards backed by Redis in Ruby – Primary author: David Czarnecki (@CzarneckiD)
- java-leaderboard – https://github.com/agoragames/java-leaderboard - Leaderboards backed by Redis in Java – Primary author: David Czarnecki (@CzarneckiD)
- scala-leaderboard – https://github.com/agoragames/scala-leaderboard – Leaderboards backed by Redis in Scala – Primary author: David Czarnecki (@CzarneckiD)
- php-leaderboard – https://github.com/agoragames/php-leaderboard – Leaderboards backed by Redis in PHP – Primary author: David Czarnecki (@CzarneckiD)
- python-leaderboard – https://github.com/agoragames/python-leaderboard - Leaderboards backed by Redis in Python – Primary author: Ola Mork (@olamork)
- clojure-leaderboard – https://github.com/agoragames/clojure-leaderboard – Leaderboards backed by Redis in Clojure – Primary author: Andrew Andkjar (@andkjar)
- erlang-leaderboard – https://github.com/agoragames/erlang-leaderboard – Leaderboards backed by Redis in Erlang – Primary author: Armando DiCianno (@greymouser)
- factory-worker – https://github.com/agoragames/factory-worker – Factories for NodeJS – Primary author: Andrew Nordman (@cadwallion)
- stache – https://github.com/agoragames/stache – A Rails 3.x (yes, even Rails 3.1) compatible Mustache Template Handler, with support for partials and a couple extra niceties to make sharing the raw templates with client-side javascript a little easier – Primary author: Matthew Wilson (@hypomodern)
- py-event – https://github.com/agoragames/pyevent – Python extension module for Niels Provos’ libevent – Primary author: Aaron Westendorf (@WashUffize)
- chai – https://github.com/agoragames/chai – Chai provides a very easy to use api for mocking/stubbing your python objects, patterned after the Mocha library for Ruby – Primary author: Aaron Westendorf (@WashUffize)
- activity_feed – https://github.com/agoragames/activity_feed – Activity feeds backed by Redis – Primary author: David Czarnecki (@CzarneckiD)
- improved_logging – https://github.com/agoragames/improved_logging – Adds improved logging capabilities to the ActiveSupport::BufferedLogger class – Primary author: David Czarnecki (@CzarneckiD)
- haigha – https://github.com/agoragames/haigha – AMQP libevent Python client – Primary author: Aaron Westendorf (@WashUffize)
- py-eventsocket – https://github.com/agoragames/py-eventsocket – Socket wrapper for libevent TCP applications – Primary author: Aaron Westendorf (@WashUffize)
- errship – https://github.com/agoragames/errship – Errship is a Rails 3.1 engine for rendering error pages inside your layout. It supports i18n, custom exceptions, and Airbrake (Hoptoad) error tracking – Primary author: Logan Koester (@logankoester)
- bettertabs – https://github.com/agoragames/bettertabs – Bettertabs is a simple Rails 3.1 Engine that includes a helper and a jquery plugin to render the needed markup and javascript for a section with tabs in a easy and declarative way – Primary author: Mario Izquierdo (@tothemario)
- seedlings – https://github.com/agoragames/seedlings – Make seeding data easier to deal with across multiple ORMs – Primary author: Matthew Wilson (@hypomodern)
- tassadar – https://github.com/agoragames/tassadar – Starcraft 2 replay parser written in pure Ruby – Primary author: Matt Pruitt (@guitsaru)
- mm_sortable_item – https://github.com/agoragames/mm_sortable_item – MongoMapper plugin that provides some basic acts-as-list style functionality on Mongo documents – Primary author: Matthew Wilson (@hypomodern)
- soonatra – https://github.com/agoragames/soonatra – Sinatra application to show a “Coming Soon” page and collect emails – Primary author: Logan Koester (@logankoester)
- javascripto – https://github.com/agoragames/javascripto – Javascripto helps organize and deliver client-side javascript – Primary author: Blake Taylor (@blakefrost)
We hope you’ve found or will find these libraries useful in your own projects.
Chef Explosion
Here at MLG, we use a product from Opscode called Chef to manage our server environments. Chef allows us to reliably manage our infrastructure by providing us with the ability to write code that describes how a server should be configured. While not perfect, it has served us well.
A Redis cache for RSS consumption
If you’ve ever wanted to include some data from an RSS/Atom feed on a page from Ruby, you’ve probably run into this problem:
It’s completely unreasonable to hammer the feed provider with a request every time the page is rendered, but it’s no more reasonable to use a big relational database like MySQL just to cache some stupid tweets or blog posts, especially if your application wouldn’t otherwise need one.
But apparently this layer of persistance has been deemed out-of-scope by the creators of popular RSS consumer libraries such as Feedzirra.
So I wrote a little gem called feedzirra-redis to take care of this as transparently as possible. You can use it just like you would Feedzirra normally, but your feeds and entries do not disappear at the end of the script, so you can do the dirty work from a Rakefile via cron instead of in the web request/response cycle while your users impatiently twiddle their thumbs.
Installation
$ gem install feedzirra-redis
See the README and test suite for example usage.
Enjoy!
Soonatra – ‘Coming Soon’ pages on Sinatra
- Some description of the project features
- A form to signup for an email list / invites
- Display a few posts from an RSS feed
- Show some screenshots of what we’re building to collect early feedback
Testing Multiple Ruby Versions and Gemsets Using RVM
I think it might be all the time I’m devoting to L.A. Noire which caused me to want to research how to test multiple Ruby versions and gemsets using RVM, but that’s besides the point. Here’s how I went about it.
Speed Up Testing With Spork
If you TATFT, embrace red-green-refactor, or you just want to speed up execution of your test suite, you might want to take a look at Spork. It will fork a test server for you that pre-loads your environment allowing you to run individual tests or your entire test suite without the startup cost of the loading the environment for each test or test suite run.
Meta Leaderboards
Traditionally, leaderboards rank players using one criteria, e.g. XP, kills, etc. What if you wanted to retrieve information from a leaderboard that combined more than one criteria? I’m going to show you how to do that.
Brightcove::API.new(:home => BrightcoveOS)
I am pleased to announce the brightcove-api gem that I maintain has a new home at the Brightcove Open Source portal.
Follow The Leader – Leaderboards with Ruby/Redis
Leaderboard: A board showing the ranking of leaders in a competition.
Do you need to create leaderboards for your application? Do you use Redis? Do you use Ruby? If you’ve answered yes to any or all of these questions, you might want to take a look at the leaderboard gem I am releasing today.
CAPTCHA failed or How I Patched ruby-recaptcha In 5 Minutes For Success
We are using the ruby-recaptcha library here at Agora Games. I got a bug from our QA department that they wanted the CAPTCHA failure message to change from ‘Captcha failed.’ to ‘CAPTCHA failed.’.






