method

install_gem_without_dependencies

Importance_0
v2_4_6 - Show latest stable - 0 notes - Class: InstallCommand
install_gem_without_dependencies(name, req) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/commands/install_command.rb, line 212
  def install_gem_without_dependencies name, req # :nodoc:
    gem = nil

    if local? then
      if name =~ /\.gem$/ and File.file? name then
        source = Gem::Source::SpecificFile.new name
        spec = source.spec
      else
        source = Gem::Source::Local.new
        spec = source.find_gem name, req
      end
      gem = source.download spec if spec
    end

    if remote? and not gem then
      dependency = Gem::Dependency.new name, req
      dependency.prerelease = options[:prerelease]

      fetcher = Gem::RemoteFetcher.fetcher
      gem = fetcher.download_to_cache dependency
    end

    inst = Gem::Installer.at gem, options
    inst.install

    require 'rubygems/dependency_installer'
    dinst = Gem::DependencyInstaller.new options
    dinst.installed_gems.replace [inst.spec]

    Gem.done_installing_hooks.each do |hook|
      hook.call dinst, [inst.spec]
    end unless Gem.done_installing_hooks.empty?

    @installed_specs.push(inst.spec)
  end
Register or log in to add new notes.