class Bundler::Plugin::Installer

def install(names, options)

def install(names, options)
  version = options[:version] || [">= 0"]
  if options[:git]
    install_git(names, version, options)
  else
    sources = options[:source] || Bundler.rubygems.sources
    install_rubygems(names, version, sources)
  end
end

def install_definition(definition)

Returns:
  • (Hash) - map of names to their specs they are installed with

Parameters:
  • definition (Definition) -- object
def install_definition(definition)
  def definition.lock(*); end
  definition.resolve_remotely!
  specs = definition.specs
  install_from_specs specs
end

def install_from_specs(specs)

Returns:
  • (Hash) - map of names to the specs

Parameters:
  • specs () -- to install
def install_from_specs(specs)
  paths = {}
  specs.each do |spec|
    spec.source.install spec
    paths[spec.name] = spec
  end
  paths
end

def install_git(names, version, options)

def install_git(names, version, options)
  uri = options.delete(:git)
  options["uri"] = uri
  source_list = SourceList.new
  source_list.add_git_source(options)
  # To support both sources
  if options[:source]
    source_list.add_rubygems_source("remotes" => options[:source])
  end
  deps = names.map {|name| Dependency.new name, version }
  definition = Definition.new(nil, deps, source_list, true)
  install_definition(definition)
end

def install_rubygems(names, version, sources)

Returns:
  • (Hash) - map of names to the specs of plugins installed

Parameters:
  • source(s) (String, Array) -- to resolve the gem
  • version (Array) -- of the gem to install
  • name (String) -- of the plugin gem to search in the source
def install_rubygems(names, version, sources)
  deps = names.map {|name| Dependency.new name, version }
  source_list = SourceList.new
  source_list.add_rubygems_source("remotes" => sources)
  definition = Definition.new(nil, deps, source_list, true)
  install_definition(definition)
end