Module Gem
In: lib/rubygems/builder.rb
lib/rubygems/command.rb
lib/rubygems/command_manager.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/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.rb

Main module to hold all RubyGem classes/modules.

Methods

Classes and Modules

Module Gem::Commands
Module Gem::DefaultUserInteraction
Module Gem::Ext
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::FakeFetcher
Class Gem::FileOperations
Class Gem::FilePermissionError
Class Gem::Format
Class Gem::FormatException
Class Gem::GemNotFoundException
Class Gem::GemNotInHomeException
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::SpecFetcher
Class Gem::Specification
Class Gem::StreamUI
Class Gem::SystemExitException
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.3.1'
ConfigMap = {} unless defined?(ConfigMap)
RbConfig = Config unless defined? ::RbConfig
DIRECTORIES = %w[cache doc gems specifications] unless defined?(DIRECTORIES)
MUTEX = Mutex.new
RubyGemsPackageVersion = RubyGemsVersion
WIN_PATTERNS = [ /bccwin/i, /cygwin/i, /djgpp/i, /mingw/i, /mswin/i, /wince/i, ]   An Array of Regexps that match windows ruby platforms.
MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
YAML_SPEC_DIR = 'quick/'

Attributes

loaded_specs  [R] 
post_install_hooks  [R]  The list of hooks to be run before Gem::Install#install does any work
post_uninstall_hooks  [R]  The list of hooks to be run before Gem::Uninstall#uninstall does any work
pre_install_hooks  [R]  The list of hooks to be run after Gem::Install#install is finished
pre_uninstall_hooks  [R]  The list of hooks to be run after Gem::Uninstall#uninstall is finished
ssl_available  [W]  Set the value of the ssl_available flag.

Public Class methods

Activates an installed gem matching gem. The gem must satisfy version_requirements.

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

Gem#activate adds the library paths in gem to $LOAD_PATH. Before a Gem is activated its required Gems are activated. If the version information is omitted, the highest version Gem of the supplied name is loaded. If a Gem is not found that meets the version requirements or a required Gem is not found, a Gem::LoadError is raised.

More information on version requirements can be found in the Gem::Requirement and Gem::Version documentation.

An Array of all possible load paths for all versions of all gems in the Gem installation.

See if a given gem is available.

The mode needed to read a file as straight binary.

The path where gem executables are to be installed.

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.

The path to standard location of the user‘s .gemrc file.

The standard configuration object for gems.

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

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

The default directory for binaries

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

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

Default gem load path

An Array of the default sources that come with RubyGems

The default system-wide source info cache directory

The default user-specific source info cache directory

A Zlib::Deflate.deflate wrapper

The path where gems are to be installed.

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 that SSL is available. Throw an exception if it is not.

Returns a list of paths matching file that can be used by a gem to pick up features from other gems. For example:

  Gem.find_files('rdoc/discover').each do |path| load path end

find_files does not search $LOAD_PATH for files, only gems.

Zlib::GzipReader wrapper that unzips data.

Zlib::GzipWriter wrapper that zips data.

A Zlib::Inflate#inflate wrapper

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

The index to insert activated gem paths into the $LOAD_PATH.

Defaults to the site lib directory unless gem_prelude.rb has loaded paths, then it inserts the activated gem‘s paths before the gem_prelude.rb paths so you can override the gem_prelude.rb default $LOAD_PATH paths.

The file name and line number of the caller of the caller of this method.

The version of the Marshal format for your Ruby.

Array of paths to search for Gems.

Array of platforms this RubyGems supports.

Set array of platforms this RubyGems supports (primarily for testing).

Adds a post-install hook that will be passed an Gem::Installer instance when Gem::Installer#install is called

Adds a post-uninstall hook that will be passed a Gem::Uninstaller instance and the spec that was uninstalled when Gem::Uninstaller#uninstall is called

Adds a pre-install hook that will be passed an Gem::Installer instance when Gem::Installer#install is called

Adds a pre-uninstall hook that will be passed an Gem::Uninstaller instance and the spec that will be uninstalled when Gem::Uninstaller#uninstall is called

The directory prefix this RubyGems was installed at.

Safely read a file in binary mode on all platforms.

Refresh source_index from disk and clear searcher.

The path to the running Ruby interpreter.

A wrapper around RUBY_ENGINE const that may not be defined

A Gem::Version for the currently running ruby.

The GemPathSearcher object used to search for matching installed gems.

Returns the Gem::SourceIndex of specifications that are in the Gem.path

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.

Need to be able to set the sources without calling Gem.sources.replace since that would cause an infinite loop.

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

Glob pattern for require-able path suffixes.

Suffixes for require-able paths.

Use the home and paths values for Gem.dir and Gem.path. Used mainly by the unit tests to provide environment isolation.

Path for gems in the user‘s home directory

The home directory for the user.

Is this a windows platform?

[Validate]