class RBS::Collection::Sources::Stdlib

signatures that are bundled in rbs gem under the stdlib/ directory

Constants

REPO

Public Instance Methods

has?(name, version) click to toggle source
# File rbs-3.4.4/lib/rbs/collection/sources/stdlib.rb, line 15
def has?(name, version)
  lookup(name, version)
end
install(dest:, name:, version:, stdout:) click to toggle source
# File rbs-3.4.4/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) click to toggle source
# File rbs-3.4.4/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() click to toggle source
# File rbs-3.4.4/lib/rbs/collection/sources/stdlib.rb, line 38
def to_lockfile
  {
    'type' => 'stdlib',
  }
end
versions(name) click to toggle source
# File rbs-3.4.4/lib/rbs/collection/sources/stdlib.rb, line 19
def versions(name)
  REPO.gems[name].versions.keys.map(&:to_s)
end

Private Instance Methods

lookup(name, version) click to toggle source
# File rbs-3.4.4/lib/rbs/collection/sources/stdlib.rb, line 44
        def lookup(name, version)
  REPO.lookup(name, version)
end