Skip to content

Instantly share code, notes, and snippets.

@wycats
Created August 10, 2008 04:25
Show Gist options
  • Save wycats/4721 to your computer and use it in GitHub Desktop.
Save wycats/4721 to your computer and use it in GitHub Desktop.
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