Module: Gem

Module | Gem
In: | lib/rubygems/builder.rb lib/rubygems/command.rb lib/rubygems/command_manager.rb lib/rubygems/commands/cleanup_command.rb lib/rubygems/commands/list_command.rb lib/rubygems/commands/rdoc_command.rb lib/rubygems/commands/search_command.rb lib/rubygems/commands/uninstall_command.rb lib/rubygems/defaults.rb lib/rubygems/digest/digest_adapter.rb lib/rubygems/digest/sha1.rb lib/rubygems/digest/sha2.rb lib/rubygems/doc_manager.rb lib/rubygems/format.rb lib/rubygems/gem_openssl.rb lib/rubygems/gem_runner.rb lib/rubygems/old_format.rb lib/rubygems/require_paths_builder.rb lib/rubygems/rubygems_version.rb lib/rubygems/source_index.rb lib/rubygems/specification.rb lib/rubygems/user_interaction.rb lib/rubygems/validator.rb lib/rubygems.rb

Main module to hold all RubyGem classes/modules.

### Methods

activate all_load_paths bindir clear_paths config_file configuration configuration= datadir default_bindir default_dir default_exec_format default_path default_sources default_system_source_cache_dir default_user_source_cache_dir dir ensure_gem_subdirectories ensure_ssl_available latest_load_paths manage_gems marshal_version path platforms prefix required_location ruby searcher source_index sources ssl_available? suffix_pattern suffixes use_paths user_home win_platform?

### Classes and Modules

Module Gem::Commands
Module Gem::DefaultUserInteraction
Module Gem::Ext
Module Gem::Indexer
Module Gem::InstallUpdateOptions
Module Gem::LocalRemoteOptions
Module Gem::Package
Module Gem::RequirePathsBuilder
Module Gem::SSL
Module Gem::Security
Module Gem::UserInteraction
Module Gem::VersionOption
Class Gem::Builder
Class Gem::Command
Class Gem::CommandLineError
Class Gem::CommandManager
Class Gem::ConfigFile
Class Gem::ConsoleUI
Class Gem::Dependency
Class Gem::DependencyError
Class Gem::DependencyInstaller
Class Gem::DependencyList
Class Gem::DependencyRemovalException
Class Gem::DigestAdapter
Class Gem::DocManager
Class Gem::DocumentError
Class Gem::EndOfYAMLException
Class Gem::Exception
Class Gem::FileOperations
Class Gem::FilePermissionError
Class Gem::Format
Class Gem::FormatException
Class Gem::GemNotFoundException
Class Gem::GemPathSearcher
Class Gem::GemRunner
Class Gem::Indexer
Class Gem::InstallError
Class Gem::Installer
Class Gem::InvalidSpecificationException
Class Gem::LoadError
Class Gem::OldFormat
Class Gem::OperationNotSupportedError
Class Gem::Platform
Class Gem::RemoteError
Class Gem::RemoteFetcher
Class Gem::RemoteInstallationCancelled
Class Gem::RemoteInstallationSkipped
Class Gem::RemoteSourceException
Class Gem::Requirement
Class Gem::Server
Class Gem::SilentUI
Class Gem::SourceIndex
Class Gem::SourceInfoCache
Class Gem::SourceInfoCacheEntry
Class Gem::Specification
Class Gem::StreamUI
Class Gem::Uninstaller
Class Gem::Validator
Class Gem::VerificationError
Class Gem::Version

### Constants

SHA1 | = | Digest::SHA1
SHA1 | = | DigestAdapter.new(Digest::SHA1)
SHA256 | = | Digest::SHA256
SHA256 | = | DigestAdapter.new(Digest::SHA256)
RubyGemsVersion | = | '1.0.1'
Cache | = | SourceIndex |  | Cache is an alias for SourceIndex to allow older YAMLized source index objects to load properly.
ConfigMap | = | {} unless defined?(ConfigMap)
RbConfig | = | Config unless defined? ::RbConfig
MUTEX | = | Mutex.new
RubyGemsPackageVersion | = | RubyGemsVersion
DIRECTORIES | = | %w[cache doc gems specifications] unless defined?(DIRECTORIES)
WIN_PATTERNS | = | [ /bccwin/i, /cygwin/i, /djgpp/i, /mingw/i, /mswin/i, /wince/i, ] |  | An Array of Regexps that match windows ruby platforms.

### External Aliases

source_index | -> | cache
| Provide an alias for the old name.

### Attributes

loaded_specs | [R] |
ssl_available | [W] | Set the value of the ssl_avilable flag.

### Public Class methods

activate(gem, autorequire, *version_requirements)

Activate a gem (i.e. add it to the Ruby load path). The gem must satisfy all the specified version constraints. If `autorequire` is true, then automatically require the specified autorequire file in the gem spec.

Returns true if the gem is loaded by this call, false if it is already loaded, or an exception otherwise.

all_load_paths()

Return a list of all possible load paths for all versions for all gems in the Gem installation.

bindir(install_dir=Gem.dir)

The directory path where executables are to be installed.

clear_paths()

Reset the `dir` and `path` values. The next time `dir` or `path` is requested, the values will be calculated from scratch. This is mainly used by the unit tests to provide test isolation.

config_file()

Return the path to standard location of the users .gemrc file.

configuration()

The standard configuration object for gems.

configuration=(config)

Use the given configuration object (which implements the ConfigFile protocol) as the standard configuration object.

datadir(gem_name)

Return the path the the data directory specified by the gem name. If the package is not available as a gem, return nil.

default_bindir()

The default directory for binaries

default_dir()

Default home directory path to be used if an alternate value is not specified in the environment.

default_exec_format()

Deduce Ruby‘s —program-prefix and —program-suffix from its install name.

default_path()

Default gem path.

default_sources()

An Array of the default sources that come with RubyGems.

default_system_source_cache_dir()

The default system-wide source info cache directory.

default_user_source_cache_dir()

The default user-specific source info cache directory.

dir()

The directory path where Gems are to be installed.

return: | [String] The directory path

ensure_gem_subdirectories(gemdir)

Quietly ensure the named Gem directory contains all the proper subdirectories. If we can‘t create a directory due to a permission problem, then we will silently continue.

ensure_ssl_available()

Ensure that SSL is available. Throw an exception if it is not.

latest_load_paths()

Return a list of all possible load paths for the latest version for all gems in the Gem installation.

manage_gems()

manage_gems is useless and deprecated. Don‘t call it anymore. This will warn in two releases.

marshal_version()

The version of the Marshal format for your Ruby.

path()

List of directory paths to search for Gems.

return: | [List<String>] List of directory paths.

platforms()
prefix()

The directory prefix this RubyGems was installed at.

required_location(gemname, libfile, *version_constraints)
ruby()

Return the Ruby command to use to execute the Ruby interpreter.

searcher()

Return the searcher object to search for matching gems.

source_index()

Returns an Cache of specifications that are in the Gem.path

return: | [Gem::SourceIndex] Index of installed Gem::Specifications

sources()

Returns an Array of sources to fetch remote gems from. If the sources list is empty, attempts to load the "sources" gem, then uses default_sources if it is not installed.

ssl_available?()

Is SSL (used by the signing commands) available on this platform?

suffix_pattern()
suffixes()
use_paths(home, paths=[])

Use the `home` and (optional) `paths` values for `dir` and `path`. Used mainly by the unit tests to provide environment isolation.

user_home()

The home directory for the user.

win_platform?()

Is this a windows platform?

[Validate]