February 19, 2010 10:47

So I started playing with rvm a while back and loved the concept of being able to have a gems(et) for each project to completely eliminate gem clashing.

So I now have an .rvmrc in each project directory with the necessary gems installed, no more, no less.

I also have a global gem set that has common gems in it that I use all over the place and aren’t really project specific so I don’t have to install them in every gems(et). Thanks Wayne!

Now, to take it to the next level I wanted to be able to use ⌘^R to run the current Cucumber scenario. So I needed to get TextMate aware of my rvm gems(et). This requires setting 3 project specific variables in TextMate.

  1. TM_RUBY

To get TM_RUBY cd into your project with a .rvmrc in it or set the environment with rvm your_ruby%gemset then run

which ruby

To get GEM_HOME and GEM_PATH run

env | grep GEM

To set these in your project you need to have the project drawer open and nothing selected, then click the “I” button in the bottom corner, then you can add your variables.

I tried to think up a way to have TextMate read the .rvmrc in the project directory, but I wasn’t able to get anything to setup the environment. If anybody has any suggestions I’d love to hear them.

April 08, 2009 07:11

So I know I’m obviously biased, but I prefer to use GemTools over the gem management feature in Rails. and here’s why.

I can deploy an app to a new server instance and not even need to have rails installed. All I have to do is
cap production deploy:setup && cap production deploy
and my cap tasks will install the full stack, including Rails.

I can also use GemTools without Rails.

I know that I will get the version of my gems that my app expects.

I’ve seen issues with using vendored gems (hpricot I’m looking at you) where even with a frozen gem it will try and include the newest version of the gem installed locally.

Don’t get me wrong, any compiled gems are going to fail in a vendored cross platform environment if the person that vendoerd it was on a different platform.

These are just a couple of the reasons that I prefer to use
gemtools install
over config.gem

I’m sure I’m in the minority, but that’s ok.

April 08, 2009 07:07

So I tend to work on different projects for different people and it’s nice to be able to sandbox things in their own world.

I know Fluid was created as an SSB (Site Specific Browser) and it’s nice for that but for me it’s more of a CSB (Client Specific Browser), I create a Fluid instance for each “client” then I can keep their wiki, issue tracker, time keeping and whatever else I need in a single app.

I find it saves me time and clutter.

February 13, 2009 12:22

So in my foray into the rails templates world I’ve stumbled onto a couple of authentication options that I wasn’t previously aware of.

Authlogic which is nice in that it moves all the actual authentication logic into a gem to make updates dead simple. The one thing I didn’t like was that you have to generate all of your own MVC code. Though honestly this isn’t such an issue now that I have it all rolled in to a Rails 2.3 template

Clearance is also nice in that it generates the MVC code yet still keeps all the authentication logic in a gem for easy updates. The only thing I didn’t really care for, though I do understand why they did it, is the inability to choose the hash algorithm.

Along comes ClearanceCrypto this provides a very similar way to choose the hashing algorithm like you can in Authlogic. The code was picked and tweaked from the Authlogic code to match the way Clearance checks the authentication.

It’s very new and may have issues. Feel free to let me know if you find anything.

February 12, 2009 12:22

And yet another big change to Strappy there is a new branch that allows you to choose the authentication method you want to use (Authlogic, Clearance or restful_authentication) it’s currently located in a branch called choosy but will probably be moving to master soon.

February 09, 2009 12:21

So of course as soon as I finished adding in the coverage to restful_authentication I found Authlogic

So I went and revamped Strappy to use Authlogic and bootstrap a ready to roll app with user logins and password resets. The original version using restful_authentication is still there in a branch.


February 05, 2009 12:20

So I went and forked the restful_authentication plugin/generator and added in the tiny bit of specs it needed to give you a clean slate when using it. No more excuses for slacking coverage.


February 05, 2009 12:19

I read an article by Stpehen Celis way back when and liked the idea behind it, but not having to add the methods to all my controllers. So I rolled it up into a gem and can now get the same functionality by doing

class FooController < ApplicationController
  expose_model :foo

and get the foo and foos methods plus the helper_methods.

You can find it on github

February 05, 2009 12:17

Ok, I admit I’m a little late to the party.

I finally stumbled onto the rails templates and really like the idea. I was using bort but I wasn’t all that hapy with some of the decisions they made, like rolling all the migrations into one monolithic beast.

I took the forked version of bort and turned it into a rails template. Very nice.

You can find strappy here

The next step I plan on is making the restful_authentication generator build specs with 100% coverage. I see no reason to start an app at 88%

October 28, 2008 22:41

Use TextMate? Can’t stand trailing whitespace in your code?

Here is a mini-Bundle that wraps a macro around ⌘-S to strip trailing whitespace and save the doc.

Strip Whitespace on Save

Just unzip it and double-click it.

If you want to change the shortcut, open the Bundle Editor and change it in the settings.