Class: Gem::Indexer

Class | Gem::Indexer
In: | lib/rubygems/indexer.rb
Parent: | Object

Top level class for building the gem repository index.

### Methods

abbreviate build_indicies build_legacy_indicies build_marshal_gemspecs build_modern_index build_modern_indicies build_rss collect_specs compact_specs compress compress_indicies gem_file_list generate_index gzip install_indicies make_temp_directories new paranoid sanitize sanitize_string update_index update_specs_index

### Included Modules

Gem::UserInteraction

### Attributes

build_legacy | [RW] | Build indexes for RubyGems older than 1.2.0 when true
build_modern | [RW] | Build indexes for RubyGems 1.2.0 and newer when true
dest_directory | [R] | Index install location
dest_latest_specs_index | [R] | Latest specs index install location
dest_prerelease_specs_index | [R] | Prerelease specs index install location
dest_specs_index | [R] | Specs index install location
directory | [R] | Index build directory

### Public Class methods

new(directory, options = {})

Create an indexer that will index the gems in `directory`.

### Public Instance methods

abbreviate(spec)

Abbreviate the spec for downloading. Abbreviated specs are only used for searching, downloading and related activities and do not need deployment specific information (e.g. list of files). So we abbreviate the spec, making it much smaller for quicker downloads.

build_indicies(index)

Build various indicies

build_legacy_indicies(index)

Builds indicies for RubyGems older than 1.2.x

build_marshal_gemspecs(index)

Builds Marshal quick index gemspecs.

build_modern_index(index, file, name)

Build a single index for RubyGems 1.2 and newer

build_modern_indicies(index)

Builds indicies for RubyGems 1.2 and newer. Handles full, latest, prerelease

build_rss(index)

Builds an RSS feed for past two days gem releases according to the gem‘s date.

collect_specs(gems = gem_file_list)

Collect specifications from .gem files from the gem directory.

compact_specs(specs)

Compacts Marshal output for the specs index data source by using identical objects as much as possible.

compress(filename, extension)

Compress `filename` with `extension`.

compress_indicies()

Compresses indicies on disk

gem_file_list()

List of gem file names to index.

generate_index()

Builds and installs indicies.

gzip(filename)

Zlib::GzipWriter wrapper that gzips `filename` on disk.

install_indicies()

Install generated indicies into the destination directory.

make_temp_directories()

Make directories for index generation

paranoid(path, extension)

Ensure `path` and path with `extension` are identical.

sanitize(spec)

Sanitize the descriptive fields in the spec. Sometimes non-ASCII characters will garble the site index. Non-ASCII characters will be replaced by their XML entity equivalent.

sanitize_string(string)

Sanitize a single string.

update_index()

Perform an in-place update of the repository from newly added gems. Only works for modern indicies, and sets build_legacy to false when run.

update_specs_index(index, source, dest)

Combines specs in `index` and `source` then writes out a new copy to `dest`. For a latest index, does not ensure the new file is minimal.

[Validate]