Skip to content

Instantly share code, notes, and snippets.

@saturnflyer
Created November 9, 2011 16:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saturnflyer/1351998 to your computer and use it in GitHub Desktop.
Save saturnflyer/1351998 to your computer and use it in GitHub Desktop.
simple load path handling
def needs(short_path)
full_path = File.expand_path(__FILE__ + '../../../' + short_path)
unless $:.include?(full_path)
$: << full_path
end
end
# Example use:
# needs('app/models')
# require 'my_model'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment