类 RBS::Collection::Sources::Stdlib

rbs gem 中 stdlib/ 目录下捆绑的签名

常量

REPO

公共实例方法

has?(name, version) 点击切换源代码
# File rbs-3.8.0/lib/rbs/collection/sources/stdlib.rb, line 15
def has?(name, version)
  lookup(name, version)
end
install(dest:, name:, version:, stdout:) 点击切换源代码
# File rbs-3.8.0/lib/rbs/collection/sources/stdlib.rb, line 23
def install(dest:, name:, version:, stdout:)
  # Do nothing because stdlib RBS is available by default
  from = lookup(name, version)
  stdout.puts "Using #{name}:#{version} (#{from})"
end
manifest_of(name, version) 点击切换源代码
# File rbs-3.8.0/lib/rbs/collection/sources/stdlib.rb, line 29
def manifest_of(name, version)
  unless path = lookup(name, version)
    RBS.logger.warn "`#{name}` is specified in rbs_collection.lock.yaml. But it is not found in #{REPO.dirs.join(",")}"
    return
  end
  manifest_path = path.join('manifest.yaml')
  YAML.safe_load(manifest_path.read) if manifest_path.exist?
end
to_lockfile() 点击切换源代码
# File rbs-3.8.0/lib/rbs/collection/sources/stdlib.rb, line 38
def to_lockfile
  {
    'type' => 'stdlib',
  }
end
versions(name) 点击切换源代码
# File rbs-3.8.0/lib/rbs/collection/sources/stdlib.rb, line 19
def versions(name)
  REPO.gems[name].versions.keys.map(&:to_s)
end

私有实例方法

lookup(name, version) 点击切换源代码
# File rbs-3.8.0/lib/rbs/collection/sources/stdlib.rb, line 44
        def lookup(name, version)
  REPO.lookup(name, version)
end