Class: RBS::Collection::Sources::Stdlib
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
Singleton,
Base
|
|
Inherits: | Object |
Defined in: | lib/rbs/collection/sources/stdlib.rb |
Overview
signatures that are bundled in rbs gem under the stdlib/ directory
Constant Summary
Instance Method Summary
- #has?(config_entry) ⇒ Boolean
- #install(dest:, config_entry:, stdout:)
- #manifest_of(config_entry)
- #to_lockfile
- #versions(config_entry)
- #lookup(config_entry) private
Base
- Included
Instance Method Details
#has?(config_entry) ⇒ Boolean
# File 'lib/rbs/collection/sources/stdlib.rb', line 15
def has?(config_entry) lookup(config_entry) end
#install(dest:, config_entry:, stdout:)
[ GitHub ]# File '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
#lookup(config_entry) (private)
[ GitHub ]# File 'lib/rbs/collection/sources/stdlib.rb', line 43
private def lookup(config_entry) REPO.lookup(config_entry['name'], config_entry['version']) end
#manifest_of(config_entry)
[ GitHub ]# File '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
[ GitHub ]# File 'lib/rbs/collection/sources/stdlib.rb', line 37
def to_lockfile { 'type' => 'stdlib', } end
#versions(config_entry)
[ GitHub ]# File 'lib/rbs/collection/sources/stdlib.rb', line 19
def versions(config_entry) REPO.gems[config_entry['name']].versions.keys.map(&:to_s) end