# File lib/puppet/provider/package/gem.rb, line 70
 70:     def install(useversion = true)
 71:         command = [command(:gemcmd), "install"]
 72:         if (! resource[:ensure].is_a? Symbol) and useversion
 73:             command << "-v" << resource[:ensure]
 74:         end
 75:         # Always include dependencies
 76:         command << "--include-dependencies"
 77: 
 78:         if source = resource[:source]
 79:             begin
 80:                 uri = URI.parse(source)
 81:             rescue => detail
 82:                 fail "Invalid source '%s': %s" % [uri, detail]
 83:             end
 84: 
 85:             case uri.scheme
 86:             when nil
 87:                 # no URI scheme => interpret the source as a local file
 88:                 command << source
 89:             when /file/i
 90:                 command << uri.path
 91:             when 'puppet'
 92:                 # we don't support puppet:// URLs (yet)
 93:                 raise Puppet::Error.new("puppet:// URLs are not supported as gem sources")
 94:             else
 95:                 # interpret it as a gem repository
 96:                 command << "--source" << "#{source}" << resource[:name]
 97:             end
 98:         else
 99:             command << resource[:name]
100:         end
101: 
102:         output = execute(command)
103:         # Apparently some stupid gem versions don't exit non-0 on failure
104:         if output.include?("ERROR")
105:             self.fail "Could not install: %s" % output.chomp
106:         end
107:     end