class RBS::Collection::Sources::Stdlib

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

Constants

REPO

Public Instance Methods

has?(config_entry) click to toggle source
# File rbs-2.7.0/lib/rbs/collection/sources/stdlib.rb, line 15
def has?(config_entry)
  lookup(config_entry)
end
install(dest:, config_entry:, stdout:) click to toggle source
# File rbs-2.7.0/lib/rbs/collection/sources/stdlib.rb, line 23
def install(dest:, config_entry:, stdout:)
  # Do nothing because stdlib RBS is available by default
  name = config_entry['name']
  version = config_entry['version'] or raise
  from = lookup(config_entry)
  stdout.puts "Using #{name}:#{version} (#{from})"
end
manifest_of(config_entry) click to toggle source
# File rbs-2.7.0/lib/rbs/collection/sources/stdlib.rb, line 31
def manifest_of(config_entry)
  config_entry['version'] or raise
  manifest_path = (lookup(config_entry) or raise).join('manifest.yaml')
  YAML.safe_load(manifest_path.read) if manifest_path.exist?
end
to_lockfile() click to toggle source
# File rbs-2.7.0/lib/rbs/collection/sources/stdlib.rb, line 37
def to_lockfile
  {
    'type' => 'stdlib',
  }
end
versions(config_entry) click to toggle source
# File rbs-2.7.0/lib/rbs/collection/sources/stdlib.rb, line 19
def versions(config_entry)
  REPO.gems[config_entry['name']].versions.keys.map(&:to_s)
end

Private Instance Methods

lookup(config_entry) click to toggle source
# File rbs-2.7.0/lib/rbs/collection/sources/stdlib.rb, line 43
        def lookup(config_entry)
  REPO.lookup(config_entry['name'], config_entry['version'])
end