Aug 282011
 

Ruby’s standard library includes the Singleton module, which lets you easily implement the singleton pattern. It can make unit testing a little difficult, though, because you cannot easily instantiate different versions of the class. This post will look at three solutions, two of which are hackish/wrong, and one of which is basic and clean (imho). Continue reading »

Mar 032010
 

For Inspectinator (a sinatra microapp), I needed a database-less authentication solution that was as lightweight as possible, but with a reasonable amount of security and maintainability. I came up with something that suits this purpose well, and I’m sharing it in case anyone is looking for something similar. I call it EasyAuth. Continue reading »

Feb 142010
 

I’ve been wanting to experiment with sinatra for a while, so I popped something off my things-to-do-someday list and put together Inspectinator.  It’s aim is pretty straight-forward: parse standard ruby #inspect strings into a more palatable form.  It parses a string into a system of nested objects, and displays it as a tree.  Some simple jQuery let’s you drill down to the level of detail you want. Continue reading »

Aug 242009
 

I’ve been playing around with Erlang lately, and it’s been quite a departure from the language I’m most comfortable with (and use everyday): Ruby. As part of my exploration, I’m doing a variety of sample problems (from the “Programming Erlang” book, among other places) in both Ruby and Erlang, and comparing the different implementations I come up with. Continue reading »

Jul 212009
 

Of course, now that I have a new G1, I want to start writing apps for it. Android apps are written in Java, but not having touched that since college, I started looking at ways to get ruby onto it instead. There was plenty of chatter about the possibility of running jruby on the device, but there are also frameworks that claim to allow you to write apps in ruby and push them to a variety of mobile platforms (android, iPhone, etc). I’ll be hearing a talk about Appcelerator Titanium at Ruby Hoedown in August, but I haven’t gotten into their closed beta, so I’ll have to wait to try that out. The other (similar) solution I came across was Rhodes, which is available now (so that’s what I’ll start with). Continue reading »