Created
April 12, 2015 23:41
-
-
Save compwron/d645e5e4ce60e035c534 to your computer and use it in GitHub Desktop.
run if file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Only run the following code when this file is the main file being run | |
# instead of having been required or loaded by another file | |
if __FILE__==$0 | |
# Find the parent directory of this file and add it to the front | |
# of the list of locations to look in when using require | |
$:.unshift File.expand_path("../../", __FILE__) | |
end | |
# http://stackoverflow.com/questions/4687680/what-does-if-file-0-mean-in-ruby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment