Created
August 11, 2017 02:26
-
-
Save b-coimbra/0a48bf1427191d4cbb12bcd70e0464d2 to your computer and use it in GitHub Desktop.
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
# require gems, installs dependencies | |
def __import__(*lib) | |
lib.each do |i| | |
begin | |
require i | |
rescue LoadError | |
system "gem install #{i}" | |
Gem.clear_paths | |
retry | |
end | |
end | |
end | |
# USAGE: | |
__import__("eat", "nokogiri", "sass", "bundler") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment