# File lib/automateit/package_manager/egg.rb, line 14 def installed?(*packages) return _installed_helper?(*packages) do |list, opts| cmd = "python -c 'import sys; print(sys.path)' 2>&1" log.debug(PEXEC+cmd) data = `#{cmd}` # Extract array elements, turn them into basenames, and then split on # '-' because that's the separator for the name and version. found = data.scan(/'([^']+\.egg)'/).flatten.map{|t| File.basename(t).split('-', 2)[0]} available = found & list end end