123456789_123456789_123456789_123456789_123456789_

Exception: Gem::ImpossibleDependenciesError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Exception, Deprecate, RuntimeError
Instance Chain:
self, Exception, RuntimeError
Inherits: Gem::Exception
Defined in: lib/rubygems/exceptions.rb

Overview

Raised by Resolver when dependencies conflict and create the inability to find a valid possible spec for a request.

Class Method Summary

Deprecate - Extended

deprecate

Simple deprecation method that deprecates name by wrapping it up in a dummy method.

skip_during

Temporarily turn off warnings.

Instance Attribute Summary

Exception - Inherited

Instance Method Summary

Constructor Details

.new(request, conflicts) ⇒ ImpossibleDependenciesError

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 143

def initialize(request, conflicts)
  @request   = request
  @conflicts = conflicts

  super build_message
end

Instance Attribute Details

#conflicts (readonly)

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 140

attr_reader :conflicts

#request (readonly)

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 141

attr_reader :request

Instance Method Details

#build_message

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 150

def build_message # :nodoc:
  requester  = @request.requester
  requester  = requester ? requester.spec.full_name : 'The user'
  dependency = @request.dependency

  message = "#{requester} requires #{dependency} but it conflicted:\n".dup

  @conflicts.each do |_, conflict|
    message << conflict.explanation
  end

  message
end

#dependency

[ GitHub ]

  
# File 'lib/rubygems/exceptions.rb', line 164

def dependency
  @request.dependency
end