1
require 'rubygems/command'
2
require 'rubygems/server'
4
class Gem::Commands::ServerCommand < Gem::Command
7
super 'server', 'Documentation and gem repository HTTP server',
8
:port => 8808, :gemdir => Gem.dir, :daemon => false
10
add_option '-p', '--port=PORT', Integer,
11
'port to listen on' do |port, options|
15
add_option '-d', '--dir=GEMDIR',
16
'directory from which to serve gems' do |gemdir, options|
17
options[:gemdir] = File.expand_path gemdir
20
add_option '--[no-]daemon', 'run as a daemon' do |daemon, options|
21
options[:daemon] = daemon
25
def defaults_str # :nodoc:
26
"--port 8808 --dir #{Gem.dir} --no-daemon"
29
def description # :nodoc:
31
The server command starts up a web server that hosts the RDoc for your
32
installed gems and can operate as a server for installation of gems on other
35
The cache files for installed gems must exist to use the server as a source
38
To install gems from a running server, use `gem install GEMNAME --source
39
http://gem_server_host:8808`
44
Gem::Server.run options