Recent Posts

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.

Announcement: New Ruby on Rails Deployment Group

January 23, 2007

Our team is working on a new hosting solution[^1^](#fn1){#fnref1 .footnote-ref role=”doc-noteref”} for Rails applications. Throughout this process, we’ve been reviewing all the various methods that our team and customers have been using to deploy and host applications written with Ruby on Rails. Our team has been able to closely watch the technologies change on our servers for almost two full years to accommodate the latest in deployment solutions.

Recently, a few deployment savvy customers of ours and us decided that it was time to take some of our experiences and conversations out into the public. We’d like to invite all of you that are interested in Rails deployment to join the new Deploying Rails google group. Whether you’re trying to setup a staging server, deploy to a shared solution like we offer at PLANET ARGON, managing your own VPS, or configuring a cluster of servers for your big launch, we’d love to talk with you about this stuff.

I’m secretly hoping that all the talented Rails deployment experts, like our friends at Rails Machine and Engine Yard, will join us in our effort. :-)

If you’re still hosting your Rails application on Apache and FCGI in a shared environment, this list is for you! ;-)

Join the group today!

UPDATE Zed Shaw has entered the building…


  1. ::: {#fn1}
Stay tuned in early February... ;-)[↩︎](#fnref1){.footnote-back
role="doc-backlink"}
:::

Every Second Counts with a Piston in your Trunk

January 16, 2007

Recently, I wrote about using RSpec and autotest (…which I think should be called autospec) together to help boost productivity while working on Rails projects. It seems that a few members of the PLANET ARGON team have picked up on using it, which I’m happy to hear about. :-)

It’s not the only thing that I’m happy about though.

I recently came across another gem. Several of my comrades in #caboose are using piston to manage external plugins for Ruby on Rails. Wait! Isn’t this what Subversion externals is meant for? Well, yes… but externals also eat away at productivity. For example, each day, we may have anywhere from 4-6 designers and developers working on one client project. When we’re in crunch mode, this could account for quite a few subversion commits throughout the day. We all know that we should run svn up on a regular basis to make sure that we’re keeping things in sync… especially when designers and developers are working really closely and fine tuning something specific in the application. Well, the one downside to this process is that each svn up not only checks our repository, but it also checks external repositories.

“But wait! Can’t you just ignore externals on an update?”

Of course, but who wants to type out —ignore-externals each time they run an update? …or perhaps you could make an alias for this in your shell. In any event, everyone on the team is then left to be responsible for doing this… and an extra 30-60 seconds (if not longer) per svn update times x number of people on project… well… time wasted if you’re closely watching the svn updates. Also, TextMate doesn’t have an option currently (that I could find) to ignore externals, so for those who manage subversion through it… they’re waiting on externals within their primary workspace.

Another issue with svn externals is that when a repository goes down, it really starts to slow stuff down your updates. This is always fun when you go to deploy your application with Capistrano and realize that you can’t finish the update because it can’t connect it to http://svn.lazyatom.com/public/plugins/acts_as_hasselhoff/ to make sure that your application has the latest version of the best plugins available for Rails.

acts_as_hasselhoff{width=”240” height=”160”}

Then there is the whole issue of wanting to make changes to the plugin that you’re including as an external. How does that fit into the whole mix?

There is Hope!

Piston encourages you to keep your external plugins in your local repository. Don’t worry, it remembers where it retrieved the code from so that you can update from the external repository at any time.

Installing Piston

Again, this is really simple like most gems.