class Gem::Source::Lock - Documentation for Ruby 4.0
Description: class Gem::Source::Lock: A Lock source wraps an installed gem's source and sorts before other sources during dependency resolution. This allows RubyGems to prefer gems from de
Keywords: ruby,class,Gem::Source::Lock

🔍

No recent searches

# class Gem::Source::Lock

A `Lock` source wraps an installed gem’s source and sorts before other sources during dependency resolution. This allows RubyGems to prefer gems from dependency lock files.

### Attributes

wrapped [R]

The wrapped `Gem::Source`

### Public Class Methods

new (source)
Source

    # File lib/rubygems/source/lock.rb, line 18
    def initialize(source)
      @wrapped = source
    end

Creates a new `Lock` source that wraps `source` and moves it earlier in the sort list.

### Public Instance Methods

fetch_spec (name_tuple)
Source

    # File lib/rubygems/source/lock.rb, line 42
    def fetch_spec(name_tuple)
      @wrapped.fetch_spec name_tuple
    end

Delegates to the wrapped source’s `fetch_spec` method.