method

install_gem

Importance_0
v2_1_10 - Show latest stable - 0 notes - Class: InstallCommand
install_gem(name, version) 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 197
  def install_gem name, version # :nodoc:
    return if options[:conservative] and
      not Gem::Dependency.new(name, version).matching_specs.empty?

    req = Gem::Requirement.create(version)

    if options[:ignore_dependencies] then
      install_gem_without_dependencies name, req
    else
      inst = Gem::DependencyInstaller.new options

      if options[:explain]
        request_set = inst.resolve_dependencies name, req

        puts "Gems to install:"

        request_set.specs.map { |s| s.full_name }.sort.each do |s|
          puts "  #{s}"
        end

        return
      else
        inst.install name, req
      end

      @installed_specs.push(*inst.installed_gems)

      show_install_errors inst.errors
    end
  end
Register or log in to add new notes.