class Gem::Molinillo::Resolver

这个类封装了一个依赖解析器。解析器负责决定要激活哪些依赖项集合,并从 {#specification_provider} 获取反馈。

属性

resolver_ui[R]

@return [UI] 用于与用户通信的 UI 模块

during the resolution process
specification_provider[R]

@return [SpecificationProvider] 使用的规范提供者

in the resolution process

公共类方法

new(specification_provider, resolver_ui) 点击切换源码

初始化一个新的解析器。@param [SpecificationProvider] specification_provider

see {#specification_provider}

@param [UI] resolver_ui

see {#resolver_ui}
# File rubygems/vendor/molinillo/lib/molinillo/resolver.rb, line 27
def initialize(specification_provider, resolver_ui)
  @specification_provider = specification_provider
  @resolver_ui = resolver_ui
end

公共实例方法

resolve(requested, base = DependencyGraph.new) 点击切换源码

将请求的依赖项解析为 {DependencyGraph},锁定到基本依赖图(如果指定) @param [Array] requested 一个“请求的”依赖项数组

{#specification_provider} can understand

@param [DependencyGraph,nil] base 基本依赖图,依赖项将

dependencies should be 'locked'
# File rubygems/vendor/molinillo/lib/molinillo/resolver.rb, line 38
def resolve(requested, base = DependencyGraph.new)
  Resolution.new(specification_provider,
                 resolver_ui,
                 requested,
                 base).
    resolve
end