Skip to content

Instantly share code, notes, and snippets.

@gilesbowkett
Created April 23, 2009 23:05
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 gilesbowkett/100820 to your computer and use it in GitHub Desktop.
Save gilesbowkett/100820 to your computer and use it in GitHub Desktop.
# http://gilesbowkett.blogspot.com/2009/04/unshiftfiledirnamefile.html
class File
class << self
def here(__file__, string)
expand_path(dirname(__file__)) + string
end
end
end
# usage
%w{foo
bar
baz}.each do |file|
require File.here(__FILE__, "/lib/#{file}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment