Class: Gem::Resolver::Molinillo::DependencyState

Inherits:
ResolutionState show all
Defined in:
lib/rubygems/resolver/molinillo/lib/molinillo/state.rb

Overview

A state that encapsulates a set of ResolutionState#requirements with an Array of possibilities

Instance Attribute Summary

Attributes inherited from ResolutionState

#activated, #conflicts, #depth, #name, #possibilities, #requirement, #requirements

Instance Method Summary collapse

Methods inherited from ResolutionState

empty

Instance Method Details

#pop_possibility_statePossibilityState

Removes a possibility from ‘self`

Returns:

  • (PossibilityState)

    a state with a single possibility, the possibility that was removed from ‘self`



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/state.rb', line 35

def pop_possibility_state
  PossibilityState.new(
    name,
    requirements.dup,
    activated,
    requirement,
    [possibilities.pop],
    depth + 1,
    conflicts.dup
  ).tap do |state|
    state.activated.tag(state)
  end
end