Created
August 10, 2008 04:25
-
-
Save wycats/4721 to your computer and use it in GitHub Desktop.
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
def requirable?(filename) | |
result = fork do | |
begin | |
require filename | |
exit!(0) | |
rescue | |
exit!(1) | |
end | |
end | |
result == 0 ? true : false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment