MetaSkills.net

Using Autotest For Rails Plugin Development

Posted On: September 19th, 2008 by kencollins

I love autotest. I have event posted before how to extend the idea of autotest sounds to a red/green playlist but now that I am taking more time to extract some of my work to plugins, I really wanted autotest to come with me. The problem is that the default autotest mappings do not play with rails conventions, the biggest being that test files for a lib match the name of the lib with _test.rb at the END of the...

Coulda Shoulda Woulda

Posted On: May 29th, 2008 by kencollins

It has been about 6 months now since I started using the Shoulda testing plugin as my BDD/TDD tool of choice. Unlike a lot of other people, I did not flock to the RSpec bandwaggon. Personally I think RSpec is horribly bloated a sledgehammer for a simple issue, the need to have test code organized with nested setups and context blocks.

Rake task to read and write the ActiveRecord schema version table.

Posted On: January 31st, 2007 by kencollins

After attending Rails Edge in Reston, Virginia I decided to move some common tasks from my ~/.irbrc file and put them into Rake. I thought I would share a task that reads and writes the ActiveRecord schema table. Sometimes in migrations this is either good to know or manually change. Simply copy this in a foo.task file in your project/lib/tasks directory and use rake -T to see the description and usage. I have placed these tasks in the db:version namespace.

Custom Rake Task To Unload Fixtures

Posted On: October 2nd, 2006 by kencollins

I made a revised version of a rake task that I have used quite often, for unloading existing DB tables into fixture data and thought I would share. This rake task is the in correct name space and adds a "rake db:fixtures:unload" command to your rails project when you put this in "lib/tasks/foo.rake". It can take an optional TABLES variable or if none is present the whole array of DB tables are converted. I find this rake task helpful when dealing with LARGE databases.

Quake Style Terminal Window on OS X

Posted On: June 12th, 2006 by kencollins

Visor Screenshot

Well this is far beyond cool but highly functional, a Quake like terminal implementation of Terminal.app that is a HotKey away from within any application. A friend turned me on to this after it showed up on the Monday morning Apple links post from arstechnica.com. Although I have never thought of this idea, it seems to have been a popular request for quite some time and after a public request, the author of QuickSilver stepped up to the challenge and coded this little goodie using the application enhancer method called SIMBL which was created by Mike Solomon, the creator of the PithHelmet plugin for Safari.

Tags: apple, osx, terminal

Getting On Good Terms With The OS X Shell

Posted On: March 19th, 2006 by kencollins

iTerm Logo I will be the first to admit that I am really just learning how to tap into the power of my shell environment and to be honest, I've spent way to many hours reading man pages and figuring out how to do some really neat things that help my automate my workflow and system administration. Mostly these are just basic tasks like my Simple MySQL Backup and Deleting Invisible Resource Files scripts. But in all seriousness, when you get right down to using a UNIX-based operating system, you cannot escape using the shell environment. This is a good thing, its your friend, and getting your feet wet sooner than later is a good idea.

Shell Script To Delete All Invisible ._ Resource Files

Posted On: February 23rd, 2006 by kencollins

Network DriveIf you have ever accessed your website using a network protocol such as the Apple Filing Protocol (AFP), Samba (SMB), Web-based Distributed Authoring and Versioning (WebDAV), or Network File System (NFS) using your Mac – I am sure you have run into this problem before – dreaded invisible resource fork files. These are the files that begin with a ._ and they are normally not seen from within the finder. My understanding is that these files are not even created on your local Mac hard drive since the HFS+ file system is smart enough to keep your data and resource forks together in one single file. But even if you are accessing your website from one Mac HFS+ volume to another Mac HFS+ volume, these files will still be created by programs like DreamWeaver and TextMate because the various protocols to access that remote share and/or the file systems themselves will need to split them to cope. So ultimately when ever you use these other types of file systems or network protocols, you will eventually be creating lost of invisible resource fork files.