method
run
v2_4_6 -
Show latest stable
-
0 notes -
Class: Server
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
run()
public
Hide source
# File lib/rubygems/server.rb, line 795 def run listen WEBrick::Daemon.start if @daemon @server.mount_proc "/specs.#{Gem.marshal_version}", method(:specs) @server.mount_proc "/specs.#{Gem.marshal_version}.gz", method(:specs) @server.mount_proc "/latest_specs.#{Gem.marshal_version}", method(:latest_specs) @server.mount_proc "/latest_specs.#{Gem.marshal_version}.gz", method(:latest_specs) @server.mount_proc "/prerelease_specs.#{Gem.marshal_version}", method(:prerelease_specs) @server.mount_proc "/prerelease_specs.#{Gem.marshal_version}.gz", method(:prerelease_specs) @server.mount_proc "/quick/", method(:quick) @server.mount_proc("/gem-server-rdoc-style.css") do |req, res| res['content-type'] = 'text/css' add_date res res.body << RDOC_CSS end @server.mount_proc "/", method(:root) @server.mount_proc "/rdoc", method(:rdoc) file_handlers = { '/gems' => '/cache/', } if have_rdoc_4_plus? then @server.mount '/doc_root', RDoc::Servlet, '/doc_root' else file_handlers['/doc_root'] = '/doc/' end @gem_dirs.each do |gem_dir| file_handlers.each do |mount_point, mount_dir| @server.mount(mount_point, WEBrick::HTTPServlet::FileHandler, File.join(gem_dir, mount_dir), true) end end trap("INT") { @server.shutdown; exit! } trap("TERM") { @server.shutdown; exit! } launch if @launch @server.start end