module AgapeRedRecipes::Gems

Public Instance Methods

all_gem_names() click to toggle source
# File lib/agape-red-recipes/modules/gems.rb, line 15
def all_gem_names
  Gem::Specification.collect &:name
end
missing_gems?(*gem_names) click to toggle source
# File lib/agape-red-recipes/modules/gems.rb, line 4
def missing_gems?(*gem_names)
  gem_names = [gem_names].flatten
  gem_names - all_gem_names
end
require_gems!(*gem_names) click to toggle source
# File lib/agape-red-recipes/modules/gems.rb, line 9
def require_gems!(*gem_names)
  missing_gems = missing_gems?(gem_names)
  return if missing_gems.empty?
  abort "Please install the gems #{missing_gems.join(" and ")} before installing."
end