Public Class Methods

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.

Find the full path to the executable for gem name. If the
exec_name is not given, the gem’s default_executable is
chosen, otherwise the specified executable’s path is returned.
requirements allows you to specify specific gem versions.

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.

# File rubygems.rb, line 649defself.load_yamlreturnif@yaml_loadedtest_syck = ENV['TEST_SYCK']
unlesstest_syckbegingem'psych', '~> 1.2', '>= 1.2.1'rescueGem::LoadError# It's OK if the user does not have the psych gem installed. We will# attempt to require the stdlib versionendbegin# Try requiring the gem version *or* stdlib version of psych.require'psych'rescue::LoadError# If we can't load psych, thats fine, go on.else# If 'yaml' has already been required, then we have to# be sure to switch it over to the newly loaded psych.ifdefined?(YAML::ENGINE) &&YAML::ENGINE.yamler!="psych"YAML::ENGINE.yamler = "psych"endrequire'rubygems/psych_additions'require'rubygems/psych_tree'endendrequire'yaml'# If we're supposed to be using syck, then we may have to force# activate it via the YAML::ENGINE API.iftest_syckanddefined?(YAML::ENGINE)
YAML::ENGINE.yamler = "syck"unlessYAML::ENGINE.syck?end# Now that we're sure some kind of yaml library is loaded, pull# in our hack to deal with Syck's DefaultKey ugliness.require'rubygems/syck_hack'@yaml_loaded = trueend

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.