Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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