new(options = {})
public
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
|
# File lib/rubygems/dependency_installer.rb, line 46
def initialize(options = {})
if options[:install_dir] then
@gem_home = options[:install_dir]
Gem::Specification.dirs = @gem_home
Gem.ensure_gem_subdirectories @gem_home
options[:install_dir] = @gem_home # FIX: because we suck and reuse below
end
options = DEFAULT_OPTIONS.merge options
@bin_dir = options[:bin_dir]
@development = options[:development]
@domain = options[:domain]
@env_shebang = options[:env_shebang]
@force = options[:force]
@format_executable = options[:format_executable]
@ignore_dependencies = options[:ignore_dependencies]
@prerelease = options[:prerelease]
@security_policy = options[:security_policy]
@user_install = options[:user_install]
@wrappers = options[:wrappers]
@installed_gems = []
@install_dir = options[:install_dir] || Gem.dir
@cache_dir = options[:cache_dir] || @install_dir
# Set with any errors that SpecFetcher finds while search through
# gemspecs for a dep
@errors = nil
end