class RBS::Collection::Sources::Rubygems - rbs: Ruby Standard Library Documentation

# class RBS::Collection::Sources::Rubygems

Signatures that are inclduded in gem package as sig/ directory.

### Public Instance Methods

has?(name, version) click to toggle source

    # File rbs-3.8.0/lib/rbs/collection/sources/rubygems.rb, line 13
    def has?(name, version)
      gem_sig_path(name, version)
    end

install(dest:, name:, version:, stdout:) click to toggle source

    # File rbs-3.8.0/lib/rbs/collection/sources/rubygems.rb, line 23
    def install(dest:, name:, version:, stdout:)
      # Do nothing because stdlib RBS is available by default
      _, from = gem_sig_path(name, version)
      stdout.puts "Using #{name}:#{version} (#{from})"
    end

manifest_of(name, version) click to toggle source

    # File rbs-3.8.0/lib/rbs/collection/sources/rubygems.rb, line 29
    def manifest_of(name, version)
      _, sig_path = gem_sig_path(name, version)
      sig_path or raise
      manifest_path = sig_path.join('manifest.yaml')
      YAML.safe_load(manifest_path.read) if manifest_path.exist?
    end

to_lockfile() click to toggle source

    # File rbs-3.8.0/lib/rbs/collection/sources/rubygems.rb, line 36
    def to_lockfile
      {
        'type' => 'rubygems',
      }
    end

versions(name) click to toggle source

    # File rbs-3.8.0/lib/rbs/collection/sources/rubygems.rb, line 17
    def versions(name)
      spec, _ = gem_sig_path(name, nil)
      spec or raise
      [spec.version.to_s]
    end

### Private Instance Methods

gem_sig_path(name, version) click to toggle source

    # File rbs-3.8.0/lib/rbs/collection/sources/rubygems.rb, line 42
            def gem_sig_path(name, version)
      RBS::EnvironmentLoader.gem_sig_path(name, version)
    end