Skip to content

Instantly share code, notes, and snippets.

@automatthew
Created February 4, 2009 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save automatthew/58379 to your computer and use it in GitHub Desktop.
Save automatthew/58379 to your computer and use it in GitHub Desktop.
DEPRECATED: dollarspots owns your loadpath
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.
JRuby doesn't honor RUBYOPTS, so:
export JRUBY_OPTS="-r load_dollarspots"
Also remember to install with `jruby ./install.rb`
require 'fileutils' # because some people use dyslexic operating systems
front = $:.first
puts "Copying load_dollarspots.rb to #{front}"
FileUtils.cp "./load_dollarspots.rb", "#{front}/"
DollarSpots = 0.2
local = Dir[".dollarspots.rb", "dollarspots.rb"].first
load(local) if local
home = "#{ENV['HOME']}/.dollarspots.rb"
load(home) if File.exist? home
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment