About the author

Steven Harmansteven harman :: makes sweet software with computers!

For recent posts and more about me, scroll to the bottom.

Sponsors

Subscribe

  • Subscribe to my feed. via RSS
  • Subscribe via email via email

Being Lazy with Rake

I’ve noticed Rake has been gaining some traction within the .net community as of late, or at least within a certain segment of that community.

We’re currently using Rake to automate the great bulk of an entire deployment pipeline here at VersionOne, and I know of a few teams at Quick Solutions that are doing similar things.

I believe Rake is a great tool for automating intensive processes and/or tasks and also find it to be great for handling some of the more mundane tasks we do on a daily basis. I spend a fair amount of each working day in a terminal window – running various SCM commands, compiling code, running specs, etc.

More of those trivial tasks are being replaced by simple Rake tasks. For example, I’ve started adding a Rake task something like the following to nearly every code base I work on

   1:  desc "Launch the solution in Visual Studio"
   2:  task :sln do
   3:    Thread.new do
   4:      system 'devenv #{@props[:solution_path]}'
   5:    end
   6:  end

This is a pretty simple task:

  • spins up a new thread within a block
  • then opens a new subshell via the system command
  • launches Visual Studio (via devenv) passing the path to the solution file.

As long as I have Ruby and the Rake gem installed I can execute the task from anywhere within my project structure and have Visual Studio open the solution.

> rake sln

It may seem incredibly lazy, but it comes in very hand if you like to keep your fingers on the home row. Not to mention the time saver it is on No Mouse Thursdays!

Full Disclosure: I didn’t come up with this little time saver on my own. I was inspired & then stole it from Aaron Jensen, though I’m sure he was motivated by a similar level of laziness. :)

kick it on DotNetKicks.com

Technorati Tags: ,,

What others are saying.

# re: Being Lazy with Rake
Gravatar Scott
May 29, 2009
ha!

I myself have found myself creating a quasi-retarded amount of rake tasks lately for laziness reasons. Good programmers are lazy bastards they say.
# re: Being Lazy with Rake
Gravatar Jon Kruger
May 30, 2009
That's what tools like SlickRun and Launchy are for! Win-Q + "vs" and I'm done.

Admittedly not as sexy as rake though.
# re: Being Lazy with Rake
Gravatar Steven Harman
May 30, 2009
@Jon,
SlickRun and Launch are great for firing up apps, navigating the file system, etc... but Control-Space + "vs" doesn't load the solution you're interested in for you.

Lazy! :)
# re: Being Lazy with Rake
Gravatar Robz
Jun 03, 2009
Being lazy is why I created UppercuT in the first place. :D

Of course it's not rake (it's NAnt abstracted from you) and it's only towards build automation, but it does have an open script as well.
# re: Being Lazy with Rake
Gravatar Robz
Jun 03, 2009
I totally need to learn ruby at some point. It's on the todo list. :D
# re: Being Lazy with Rake
Gravatar hometoast
Jul 07, 2009
@Steven: you can (and I do) have Launchy index *.sln files. Alt-Space, <something in sln name>, enter.
Comments have been closed on this topic.