require 'webrick' require 'yaml' require 'zlib' require 'erb' require 'rubygems' ## # Gem::Server and allows users to serve gems for consumption by # `gem --remote-install`. # # gem_server starts an HTTP server on the given port and serves the following: # * "/" - Browsing of gem spec files for installed gems # * "/Marshal" - Full SourceIndex dump of metadata for installed gems # * "/yaml" - YAML dump of metadata for installed gems - deprecated # * "/gems" - Direct access to download the installable gems # # == Usage # # gem server [-p portnum] [-d gem_path] # # port_num:: The TCP port the HTTP server will bind to # gem_path:: # Root gem directory containing both "cache" and "specifications" # subdirectories. class Gem::Server include Gem::UserInteraction DOC_TEMPLATE = <<-'WEBPAGE'
There are <%=values["gem_count"]%> gems installed:
<%= values["specs"].map { |v| "#{v["name"]}" }.join ', ' %>.