Skip to content

Instantly share code, notes, and snippets.

@jwhitlark
Created September 20, 2011 02:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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