Class: Bundler::Resolver::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/resolver/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(base, additional_base_requirements) ⇒ Base

Returns a new instance of Base.



6
7
8
9
# File 'lib/bundler/resolver/base.rb', line 6

def initialize(base, additional_base_requirements)
  @base = base
  @additional_base_requirements = additional_base_requirements
end

Instance Method Details

#[](name) ⇒ Object



11
12
13
# File 'lib/bundler/resolver/base.rb', line 11

def [](name)
  @base[name]
end

#base_requirementsObject



19
20
21
# File 'lib/bundler/resolver/base.rb', line 19

def base_requirements
  @base_requirements ||= build_base_requirements
end

#delete(spec) ⇒ Object



15
16
17
# File 'lib/bundler/resolver/base.rb', line 15

def delete(spec)
  @base.delete(spec)
end

#unlock_deps(deps) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/bundler/resolver/base.rb', line 23

def unlock_deps(deps)
  exact, lower_bound = deps.partition(&:specific?)

  exact.each do |exact_dep|
    @base.delete_by_name_and_version(exact_dep.name, exact_dep.requirement.requirements.first.last)
  end

  lower_bound.each do |lower_bound_dep|
    @additional_base_requirements.delete(lower_bound_dep)
  end

  @base_requirements = nil
end