Skip to content

Instantly share code, notes, and snippets.

@ab5tract
Forked from automatthew/README
Created February 5, 2009 03:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ab5tract/58536 to your computer and use it in GitHub Desktop.
Save ab5tract/58536 to your computer and use it in GitHub Desktop.
Stop putting "require 'rubygems'" in your project files. Just madly require
away, assuming that whatever you need will be found in the load path.
Install dollarspots.rb early in your loadpath. It checks the pwd for a file
named .dollarspots.rb and loads it if found. Use .dollarspots.rb files locally
in projects to jigger with your loadpath such that your reckless requires
actually work. Note that this may involve saying "require 'rubygems'".
Call ruby with -rdollarspots, or set "rdollarspots" as your RUBYOPT. To get TextMate's RubyMate facilities to work you'll need to edit the RUBYOPT shell variable in the Prefs.
load("./.dollarspots.rb") if File.exist?("./.dollarspots.rb")
require 'fileutils' # because some people use dyspeptic operating systems
front = $:.first
FileUtils.cp "./dollarspots.rb", "#{front}/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment