method

install_gem

Importance_0
v2_5_5 - 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 184
  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
      request_set = inst.resolve_dependencies name, req

      if options[:explain]
        puts "Gems to install:"

        request_set.sorted_requests.each do |s|
          puts "  #{s.full_name}"
        end

        return
      else
        @installed_specs.concat request_set.install options
      end

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