# File lib/automateit/package_manager/gem.rb, line 16 def installed?(*packages) return _installed_helper?(*packages) do |list, opts| cmd = "gem list --local 2>&1" log.debug(PEXEC+cmd) data = `#{cmd}` # Gem lists packages out of order, which screws up the # install/uninstall sequence, so we need to put them back in the # order that the user specified. present = data.scan(/^([^\s\(]+)\s+\([^\)]+\)\s*$/).flatten available = [] for package in list available << package if present.include?(package) end available end end