Class: Gem::Resolver::State

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubygems/resolver.rb

Overview

Contains the state for attempting activation of a set of possible specs. needed is a Gem::List of DependencyRequest objects that, well, need to be satisfied. specs is the List of ActivationRequest that are being tested. dep is the DependencyRequest that was used to generate this state. spec is the Specification for this state. possible is List of DependencyRequest objects that can be tried to find a complete set. conflicts is a [DependencyRequest, Conflict] hit tried to activate the state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conflictsObject

Returns the value of attribute conflicts

Returns:

  • (Object)

    the current value of conflicts



235
236
237
# File 'lib/rubygems/resolver.rb', line 235

def conflicts
  @conflicts
end

#depObject

Returns the value of attribute dep

Returns:

  • (Object)

    the current value of dep



235
236
237
# File 'lib/rubygems/resolver.rb', line 235

def dep
  @dep
end

#neededObject

Returns the value of attribute needed

Returns:

  • (Object)

    the current value of needed



235
236
237
# File 'lib/rubygems/resolver.rb', line 235

def needed
  @needed
end

#possiblesObject

Returns the value of attribute possibles

Returns:

  • (Object)

    the current value of possibles



235
236
237
# File 'lib/rubygems/resolver.rb', line 235

def possibles
  @possibles
end

#specObject

Returns the value of attribute spec

Returns:

  • (Object)

    the current value of spec



235
236
237
# File 'lib/rubygems/resolver.rb', line 235

def spec
  @spec
end

#specsObject

Returns the value of attribute specs

Returns:

  • (Object)

    the current value of specs



235
236
237
# File 'lib/rubygems/resolver.rb', line 235

def specs
  @specs
end

Instance Method Details

#summaryObject

:nodoc:



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/rubygems/resolver.rb', line 236

def summary # :nodoc:
  nd = needed.map { |s| s.to_s }.sort if nd

  if specs then
    ss = specs.map { |s| s.full_name }.sort
    ss.unshift ss.length
  end

  d = dep.to_s
  d << " from #{dep.requester.full_name}" if dep.requester

  ps = possibles.map { |p| p.full_name }.sort
  ps.unshift ps.length

  cs = conflicts.map do |(s, c)|
    [s.full_name, c.conflicting_dependencies.map { |cd| cd.to_s }]
  end

  { :needed => nd, :specs => ss, :dep => d, :spec => spec.full_name,
    :possibles => ps, :conflicts => cs }
end