Module | Gem |
In: |
lib/rubygems/defaults.rb
lib/rubygems/gem_openssl.rb lib/rubygems.rb |
RubyGems is the Ruby standard for publishing and managing third party libraries.
For user documentation, see:
For gem developer documentation see:
Further RubyGems documentation can be found at:
As of RubyGems 1.3.2, RubyGems will load plugins installed in gems or $LOAD_PATH. Plugins must be named ‘rubygems_plugin’ are discovered via Gem::find_files then loaded. Take care when implementing a plugin as your plugin file may be loaded multiple times if multiple versions of your gem are installed.
For an example plugin, see the graph gem which adds a `gem graph` command.
RubyGems defaults are stored in rubygems/defaults.rb. If you‘re packaging RubyGems or implementing Ruby you can change RubyGems’ defaults.
For RubyGems packagers, provide lib/rubygems/operating_system.rb and override any defaults from lib/rubygems/defaults.rb.
For Ruby implementers, provide lib/rubygems/#{RUBY_ENGINE}.rb and override any defaults from lib/rubygems/defaults.rb.
If you need RubyGems to perform extra work on install or uninstall, your defaults override file can set pre and post install and uninstall hooks. See Gem::pre_install, Gem::pre_uninstall, Gem::post_install, Gem::post_uninstall.
You can submit bugs to the RubyGems bug tracker on RubyForge
RubyGems is currently maintained by Eric Hodel.
RubyGems was originally developed at RubyConf 2003 by:
Contributors:
(If your name is missing, PLEASE let us know!)
Thanks!
-The RubyGems Team
RubyGemsVersion | = | VERSION = '1.3.5' | ||
ConfigMap | = | {} unless defined?(ConfigMap) | Configuration settings from ::RbConfig | |
DIRECTORIES | = | %w[cache doc gems specifications] unless defined?(DIRECTORIES) | Default directories in a gem repository | |
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}/" | Location of Marshal quick gemspecs on remote repositories | |
YAML_SPEC_DIR | = | 'quick/' | Location of legacy YAML quick gemspecs on remote repositories |
loaded_specs | [R] | Hash of loaded Gem::Specification keyed by name |
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] | Is SSL available? |
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.
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.
Default home directory path to be used if an alternate value is not specified in the environment
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.
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 search $LOAD_PATH for files as well as gems.
Note that find_files will return all files even if they are from different versions of the same gem.
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.
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
Promotes the load paths of the gem_name over the load paths of over_name. Useful for allowing one gem to override features in another using find_files.
Full path to libfile in gemname. Searches for the latest gem unless requirements is given.
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.
Prints the amount of time the supplied block takes to run using the debug UI output.