Created
April 8, 2012 19:50
-
-
Save havenwood/2339554 to your computer and use it in GitHub Desktop.
require multiple gems on one line
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
# Require multiple gems on one line. | |
# | |
# msgs - One or more gem names as Strings. | |
# | |
# Example | |
# | |
# requires 'pry', 'pry-doc', 'gist' | |
# #=> { "pry" => false, "pry-doc" => false, "gist" => true } | |
# | |
# Instead of | |
# | |
# require 'pry' | |
# #=> false | |
# require 'pry-doc' | |
# #=> false | |
# require 'gist' | |
# #=> true | |
def requires *gems | |
@results = {} | |
gems.each do |gem| | |
@results[gem] = require gem | |
end | |
@results | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment