class Gem::Resolver::IndexSpecification

表示从 IndexSet 返回的可能的 Specification 对象。用于在只需要 nameversion 时延迟下载完整的 Specification 对象。

公共类方法

new(set, name, version, source, platform) 点击切换源码

IndexSpecification 是从 'gem help generate_index' 中描述的索引格式创建的。

set 包含此(URL)source 的其他规范。

nameversionplatform 是 gem 的名称、版本和平台。

# File rubygems/resolver/index_specification.rb, line 18
def initialize(set, name, version, source, platform)
  super()

  @set = set
  @name = name
  @version = version
  @source = source
  @platform = Gem::Platform.new(platform.to_s)
  @original_platform = platform.to_s

  @spec = nil
end

公共实例方法

==(other) 点击切换源码
# File rubygems/resolver/index_specification.rb, line 59
def ==(other)
  self.class === other &&
    @name == other.name &&
    @version == other.version &&
    @platform == other.platform
end
dependencies() 点击切换源码

此规范的 gem 的依赖项

# File rubygems/resolver/index_specification.rb, line 34
def dependencies
  spec.dependencies
end
hash() 点击切换源码
# File rubygems/resolver/index_specification.rb, line 66
def hash
  @name.hash ^ @version.hash ^ @platform.hash
end
required_ruby_version() 点击切换源码

此规范的 required_ruby_version 约束

包含一个回退,因为在生成时,某些编组规范将其设置为 nil

# File rubygems/resolver/index_specification.rb, line 44
def required_ruby_version
  spec.required_ruby_version || Gem::Requirement.default
end
required_rubygems_version() 点击切换源码

此规范的 required_rubygems_version 约束

包含一个回退,因为规范 API 的原始版本不包含该字段,因此索引中的某些编组规范将其设置为 nil

# File rubygems/resolver/index_specification.rb, line 55
def required_rubygems_version
  spec.required_rubygems_version || Gem::Requirement.default
end