Module | Gem |
In: |
lib/rubygems.rb
lib/rubygems/defaults.rb lib/rubygems/psych_tree.rb lib/rubygems/gem_openssl.rb lib/rubygems/test_case.rb lib/rubygems/deprecate.rb |
Provides a single method deprecate to be used to declare when something is going away.
class Legacy def self.klass_method # ... end def instance_method # ... end extend Gem::Deprecate deprecate :instance_method, "X.z", 2011, 4 class << self extend Gem::Deprecate deprecate :klass_method, :none, 2011, 4 end end
QUICKLOADER_SUCKAGE | = | RUBY_VERSION =~ /^1\.9\.1/ | ||
GEM_PRELUDE_SUCKAGE | = | RUBY_VERSION =~ /^1\.9\.2/ && RUBY_ENGINE == "ruby" | Only MRI 1.9.2 has the custom prelude. | |
VERSION | = | '1.8.24' | ||
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 |
loaded_specs | [R] | Hash of loaded Gem::Specification keyed by name |
post_build_hooks | [R] | The list of hooks to be run before Gem::Install#install finishes installation |
post_install_hooks | [R] | The list of hooks to be run before Gem::Install#install does any work |
post_reset_hooks | [R] | The list of hooks to be run after Gem::Specification.reset is run. |
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_reset_hooks | [R] | The list of hooks to be run before Gem::Specification.reset is run. |
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 dep. The gem must satisfy 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 dep 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.
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 glob 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
if check_load_path is true (the default), then find_files also searches $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.
Adds a post-build hook that will be passed an Gem::Installer instance when Gem::Installer#install is called. The hook is called after the gem has been extracted and extensions have been built but before the executables or gemspec has been written. If the hook returns false then the gem‘s files will be removed and the install will be aborted.
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. If the hook returns false then the install will be aborted.
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.
Allows setting the default SourceIndex. This method is available when requiring ‘rubygems/test_case‘
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.