Storing .js files and .css files in ‘js’ and ‘css’ directories in Rails 2.2

In the years I have been working with Rails I have generally been happy to follow the conventions that it enforces. There is one that just doesn’t sit right with me and that is the decision to store .css files in a ‘stylesheets’ directory and .js files in a ‘javascripts’ directory as I prefer ‘css’ and ‘js’ directories (call me old fashioned).

Achieving this in Rails 2.2 involves changing a couple of constants. I may submit a patch with a config hook for this as it feels a little dirty changing the constants directly. Add the following lines to your environment.rb file.


ActionView::Helpers::AssetTagHelper::StylesheetAsset::DIRECTORY = 'css'.freeze
ActionView::Helpers::AssetTagHelper::JavaScriptAsset::DIRECTORY = 'js'.freeze

Yet another Git convert

So, after switching from Subversion to Git approximately a month ago, how has it been?

Well, what can I say, all the hype is deserved. Git makes things like branching, merging and tagging something that I no longer have to think about.

At first I wasn’t completely sold on the idea of keeping multiple copies of entire repositories on multiple machines as I keep my Photoshop originals etc. all in the repositories and feared it would take forever for the initial checkout (clone in Git). I have actually found completely the opposite in that by having the entire repository on my development machine (whether it be my office or laptop machine), the time that I save switching branches i.e. not having to checkout another branch remotely etc. far outweighs the initial “pull” time which is in fact extremely fast.

Hiding system files such as /usr and /bin on OSX Leopard

This is a very boring post considering it’s the first in over a year but hey, I have to start somewhere.

Since upgrading to Leopard, even on clean installs, it decides to show system files such as /usr /bin /etc etc. To re-hide these files use the following:

sudo /Developer/Tools/SetFile -a V /bin

The -a means “set attributes” and the V means make in(V)isible (obviously!?). You will need developer tools installed from the Leopard disc for this to work.

h3. Why so long since the last post?

The reason for not posting in such a long time is that I was running on a broken Typo install for ages with no time to fix it. I have now moved to WordPress as it has grown up a little since I last used it. I will be porting the Lucid theme and adding features at some point, in the meantime the Typo version is still available as a download.