Recent Posts

Poke My Brain

February 12, 2007

I’m working on a few blog articles that I’ll be posting over the next few weeks. The other day, I got another email from someone that asked me if I would write about something that I mentioned briefly in a blog post. This got me thinking… perhaps there are things that you’d like me write something on? In general, I try to keep a broad range of topics that relate to Ruby/Rails circulating and I’m planning a major overhaul to my blog (switch to mephisto in the near future?) and working on more tutorials, especially as we near the release of my book as a O’Reilly Rough Cut… and when it finally makes it to print. :-)

If there is something that you’d like to learn more about (Rails, business, agile…), feel free to drop an email to suggestions@robbyonrails.com.

Gems Gone Wild!

February 12, 2007

Mike Clark is offering everyone[^1^](#fn1){#fnref1 .footnote-ref role=”doc-noteref”} in the Ruby community Mardis Gras beads… in exchange for showing everyone your sexy gems. Chad and Bryan showed us theirs, so I figured it was my turn to show you all what I’ve been hiding beneath this shell.

Sharing Custom TextMate Bundles with Subversion

February 11, 2007

Early last year, I began to start creating a bunch of snippets and such for TextMate, all of which were lost several months ago due to Hurricane iSight. I recently decided to start building some again, especially some that sped up my RSpec writing. After creating a few, I wondered, “would anybody else on my team want to help me write some?” So, I thought that it was time to figure out how to share my bundle with others and allow them to add stuff to it… which seems like a good job for Ms. Subversion.

I couldn’t find a quick walk-through online and found myself in the #textmate IRC channel getting proper instructions. (thank you Allan)

Create Your Bundle

In TextMate, you can open up the Bundle Editor and create a new bundle. Let’s call our custom bundle, RSpec. Go ahead and begin adding some snippets, commands, etc to your new custom bundle. Once you have something in your Bundle, you’ll want to reload your bundles, by going to Bundles > Bundle Editor > Reload Bundles. This will write your new bundle to disk to ~/Library/Application\ Support/TextMate/Bundles/.

Extending ActionController, part two

February 09, 2007

One of our consulting clients consists of a team of .NET developers that are rewriting a rather large product in Ruby on Rails. Every once in a while they have a problem that needs a second set of eyes to look over in order to find a solution with Rails. One of their developers recently asked how they could extend ActionController to provide all of their controllers with an action that would interact with a custom extension they built for ActiveRecord.

One of the few examples that he found to help them do this was a short blog post that I wrote nearly two years ago, titled, Extending ActionController. Given that I wouldn’t do it that way anymore, I felt that I’d quickly post an updated way of doing something similar.

Create Your Extension

This is when you get to take advantage of that lonely lib/ directory in your Rails application. We’ll go ahead and save our custom extension as lib/giraffe_actioncontroller_ext.rb. Now let’s put some code in there.

5{width=”240” height=”181” style=”border: 2px solid #333;”}

Looking at the following example, you’ll notice that we’re creating a basic Ruby module, which contains a method named, hot_air_balloon. Within that method, we can do just about anything that we’d normally do in an controller action.

Is BDD kinkier than TDD?

February 08, 2007

If you’re in need of a compelling reason to switch from Test-Driven Development to Behavior-Driven Development. consider this.

“BDD sounds kinkier.” -Michael K. Loukides, Book Editor for O’Reilly

…on that bombshell… I am going to suggest that this be used as the official BDD logo.

There you have it. Deep down… the biggest reason that I switched from Test::Unit to RSpec. was the sex appeal. ;-)

What was your reason?

Goodbye Instiki, Hello JunebugWiki

February 06, 2007

If you’ve spent much time on the Ruby on Rails wiki, you know that the spam situation smells like rotten fruit.

We’ve been using Instiki, the same software as the Rails wiki for the PLANET ARGON Documentation Project and the spam situation was becoming an annoyance. So, we’ve switched to JunebugWiki as step one, to see how it holds up. The default styling was a nice improvement because we haven’t had much chance to update the instiki one. It might not solve all of our spam problems, but in the short term, it appears to be a more elegant solution. It’s also the first application built with camping that I have personally deployed.

So… I present to you… the new PLANET ARGON Documentation Project.

In other news, it appears that RubyURL has caught the eye of spammers, which sucks. I’m still thinking over a few possible ways to try and prevent that. :-/

Remember When?

February 02, 2007

I was looking through some old code from over two years ago, when I was playing with my first Rails applications. I noticed this hidden file in the public/ directory, called .htaccess.

Do you remember the good ‘ole days?

Business of Rails Panel at RailsConf 2007

February 02, 2007

Trying to finish my book and running PLANET ARGON consumes quite a bit of my time… so when the RailsConf people announced that they were accepting proposals for talks, I opted to pass so that it wouldn’t distract from my sprint to finish my book. :-)

This decision was even easier for me when Nathaniel Talbot invited me to be part of his proposal for a panel of people that are running companies that specialize with Ruby on Rails. I liked the idea and the other people that were invited were all people that I greatly admired and respected… so I said yes. After all, so much of my time and energy goes into this stuff and there isn’t any doubt that I spend way more time on the business side of Rails… than in code these days.

I just got an email from Nathaniel to let me know that his proposal was accepted.

So, if you’ll be at RailsConf 2007 (US), come see me on The Business of Rails panel session.

The following people are planned to be on the panel.

Moderator: Nathaniel Talbott, Terralien Inc.

Panelists include:

  • Justin Gehtland, Relevance, LLC
  • Geoffrey Grosenbach, Topfunky Corporation
  • Andre Lewis, earthcode.com
  • Joe O’Brien, EdgeCase, LLC
  • Robby Russell, Planet Argon, LLC

I hope that you all send Nathaniel some great (and tough) questions… ;-)

Goodbye Pound, Hello Nginx

February 01, 2007

I’ve been using pound for several months and it’s been a good relationship. Except, for some strange reason, I noticed that I was getting development mode errors when it was running in production mode. I thought there might be an issue with my mongrel cluster… but that wasn’t the case.

Let me give you a little background to how we’re encouraging customers to handle their deployment on PLANET ARGON.

Most of our hosting customers[^1^](#fn1){#fnref1 .footnote-ref role=”doc-noteref”} have three tiers (unless you have your own static IP address), one which we manage, two that you manage.

We handle the main web server/proxy server and proxy to your desired load balancer/proxy/server, which is generally any of the following options… depending on your preference.

Each customer has a unique proxy server port and a range of other ports for their mongrel clusters.

So… the typical setup is…

Apache(external:80) [proxies to]> Pound(localhost:8050) [proxies to]> Mongrel::Cluster(localhost:10500-10503)

Well, when a request comes in through Apache, it gets passed off to Pound and each tier has it’s own headers. By the time that it reaches Mongrel, all the requests appear to be coming from localhost.. not the remote address of the person using your application. Notice nothing but localhost requests in your production.log? …this is the reason.

So, what side-effects does this have? Well, aside from every request looking local… Rails will, by default, output a normal development-mode error message if the request is coming from localhost.

Rails 1.2 On CRN.com

January 28, 2007

I was recently asked a few questions by Stacy Cowley, a writer for CRN about the Rails 1.2 release and how our Design and Development team at PLANET ARGON is adopting it. This Q&A session resulted in a brief article titled, Ruby on Rails Gets RESTFul in Major Update, which appeared on the CRN site last Friday afternoon.

Thanks to the Rails Core team and all of those in the community who continue to help make Ruby on Rails an awesome addition in my tool belt.