Created
April 13, 2016 17:00
-
-
Save avdi/892100c9d6485a497eda3aea4ff5e423 to your computer and use it in GitHub Desktop.
Options for "soft" script dependencies
This file contains hidden or 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
if Gem::Specification.find_all_by_name("clipboard", "~> 1.0").any? | |
gem "clipboard", "~> 1.0" | |
require "clipboard" | |
# ... | |
end | |
This file contains hidden or 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
begin | |
gem "clipboard", "~> 1.0" | |
require "clipboard" | |
# ... | |
rescue LoadError | |
# NOOP | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this instance the cargo cult built a functional airport.
You may be thinking of:
Which would allow you to load some_gem regardless of how it was installed.