Skip to content

Instantly share code, notes, and snippets.

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