Skip to content

Instantly share code, notes, and snippets.

@jwhitlark
Created September 20, 2011 02:58
Show Gist options
  • Save jwhitlark/1228206 to your computer and use it in GitHub Desktop.
Save jwhitlark/1228206 to your computer and use it in GitHub Desktop.
Rake as a library, from anywhere in the filesystem
#! /usr/bin/env ruby
require 'rubygems'
gem 'rake', '>= 0.7.3'
require 'rake'
Dir.chdir('where/I/want/to/be')
Rake.application.init('my-script-name')
# Tasks go here
Rake.application.top_level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment