Class Gem::DependencyInstaller
In: lib/rubygems/dependency_installer.rb
Parent: Object

Installs a gem along with all its dependencies from local and remote gems.

Methods

Included Modules

Gem::UserInteraction

Constants

DEFAULT_OPTIONS = { :env_shebang => false, :domain => :both, # HACK dup :force => false, :format_executable => false, # HACK dup :ignore_dependencies => false, :prerelease => false, :security_policy => nil, # HACK NoSecurity requires OpenSSL. AlmostNo? Low? :wrappers => true, }

Attributes

gems_to_install  [R] 
installed_gems  [R] 

Public Class methods

Creates a new installer instance.

Options are:

:cache_dir:Alternate repository path to store .gem files in.
:domain::local, :remote, or :both. :local only searches gems in the current directory. :remote searches only gems in Gem::sources. :both searches both.
:env_shebang:See Gem::Installer::new.
:force:See Gem::Installer#install.
:format_executable:See Gem::Installer#initialize.
:ignore_dependencies:Don‘t install any dependencies.
:install_dir:See Gem::Installer#install.
:prerelease:Allow prerelease versions. See install.
:security_policy:See Gem::Installer::new and Gem::Security.
:user_install:See Gem::Installer.new
:wrappers:See Gem::Installer::new

Public Instance methods

Returns a list of pairs of gemspecs and source_uris that match Gem::Dependency dep from both local (Dir.pwd) and remote (Gem.sources) sources. Gems are sorted with newer gems preferred over older gems, and local gems preferred over remote gems.

Finds a spec and the source_uri it came from for gem gem_name and version. Returns an Array of specs and sources required for installation of the gem.

Gathers all dependencies necessary for the installation from local and remote sources unless the ignore_dependencies was given.

Installs the gem dep_or_name and all its dependencies. Returns an Array of installed gem specifications.

If the +:prerelease+ option is set and there is a prerelease for dep_or_name the prerelease version will be installed.

Unless explicitly specified as a prerelease dependency, prerelease gems that dep_or_name depend on will not be installed.

If c-1.a depends on b-1 and a-1.a and there is a gem b-1.a available then c-1.a, b-1 and a-1.a will be installed. b-1.a will need to be installed separately.

[Validate]