double-z
6/9/2013 - 8:17 PM

install gems with version and source options. TODO add gem_package bin option

install gems with version and source options. TODO add gem_package bin option

def install_gems
  new_resource.gems.each do |gem, opt|
    if opt.is_a?(Hash)
      ver = opt['version']
      src = opt['source']
    elsif opt.is_a?(String)
      ver = opt
    end
    gem_package gem do
      action :install
      source src if src
      version ver if ver && ver.length > 0
    end
  end
end