Class

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

  • “/specs.#{Gem.marshal_version}.gz” - specs name/version/platform index

  • “/latest_specs.#{Gem.marshal_version}.gz” - latest specs name/version/platform index

  • “/quick/” - Individual gemspecs

  • “/gems” - Direct access to download the installable gems

  • “/rdoc?q=” - Search for installed rdoc documentation

Usage

gem_server = Gem::Server.new Gem.dir, 8089, false
gem_server.run
Constants
No documentation available
No documentation available

CSS is copy & paste from rdoc-style.css, RDoc V1.0.1 - 20041108

No documentation available
No documentation available
Attributes
Read
No documentation available
Class Methods
No documentation available
No documentation available
Instance Methods
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Creates server sockets based on the addresses option. If no addresses were given a server socket for all interfaces is created.

No documentation available
No documentation available

Can be used for quick navigation to the rdoc documentation. You can then define a search shortcut for your browser. E.g. in Firefox connect ‘shortcut:rdoc’ to localhost:8808/rdoc?q=%s template. Then you can directly open the ActionPack documentation by typing ‘rdoc actionp’. If there are multiple hits for the search term, they are presented as a list with links.

Search algorithm aims for an intuitive search:

  1. first try to find the gems and documentation folders which name starts with the search term

  2. search for entries, that contain the search term

  3. show all the gems

If there is only one search hit, user is immediately redirected to the documentation for the particular gem, otherwise a list with results is shown.

Additional trick - install documentation for Ruby core

Note: please adjust paths accordingly use for example ‘locate yaml.rb’ and ‘gem environment’ to identify directories, that are specific for your local installation

  1. install Ruby sources

    cd /usr/src
    sudo apt-get source ruby
  2. generate documentation

    rdoc -o /usr/lib/ruby/gems/1.8/doc/core/rdoc \
      /usr/lib/ruby/1.8 ruby1.8-1.8.7.72

By typing ‘rdoc core’ you can now access the core documentation

No documentation available
No documentation available

Returns true and prepares http response, if rdoc for the requested gem name pattern was found.

The search is based on the file system content, not on the gems metadata. This allows additional documentation folders like ‘core’ for the Ruby core documentation - just put it underneath the main doc folder.

No documentation available
No documentation available