Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created April 8, 2012 19:50
Show Gist options
  • Save havenwood/2339554 to your computer and use it in GitHub Desktop.
Save havenwood/2339554 to your computer and use it in GitHub Desktop.
require multiple gems on one line
# 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