PHP 8.2.31
Preview: lock_specification.rb Size: 1.83 KB
/proc/thread-self/root/opt/alt/ruby23/lib64/ruby/2.3.0/rubygems/resolver/lock_specification.rb

# frozen_string_literal: true
##
# The LockSpecification comes from a lockfile (Gem::RequestSet::Lockfile).
#
# A LockSpecification's dependency information is pre-filled from the
# lockfile.

class Gem::Resolver::LockSpecification < Gem::Resolver::Specification

  attr_reader :sources

  def initialize set, name, version, sources, platform
    super()

    @name     = name
    @platform = platform
    @set      = set
    @source   = sources.first
    @sources  = sources
    @version  = version

    @dependencies = []
    @spec         = nil
  end

  ##
  # This is a null install as a locked specification is considered installed.
  # +options+ are ignored.

  def install options = {}
    destination = options[:install_dir] || Gem.dir

    if File.exist? File.join(destination, 'specifications', spec.spec_name) then
      yield nil
      return
    end

    super
  end

  ##
  # Adds +dependency+ from the lockfile to this specification

  def add_dependency dependency # :nodoc:
    @dependencies << dependency
  end

  def pretty_print q # :nodoc:
    q.group 2, '[LockSpecification', ']' do
      q.breakable
      q.text "name: #{@name}"

      q.breakable
      q.text "version: #{@version}"

      unless @platform == Gem::Platform::RUBY then
        q.breakable
        q.text "platform: #{@platform}"
      end

      unless @dependencies.empty? then
        q.breakable
        q.text 'dependencies:'
        q.breakable
        q.pp @dependencies
      end
    end
  end

  ##
  # A specification constructed from the lockfile is returned

  def spec
    @spec ||= Gem::Specification.find { |spec|
      spec.name == @name and spec.version == @version
    }

    @spec ||= Gem::Specification.new do |s|
      s.name     = @name
      s.version  = @version
      s.platform = @platform

      s.dependencies.concat @dependencies
    end
  end

end

Directory Contents

Dirs: 1 × Files: 26

Name Size Perms Modified Actions
molinillo DIR
- drwxr-xr-x 2024-03-03 22:43:28
Edit Download
3.74 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
2.46 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.95 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.61 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.18 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
3.36 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
282 B lrw-r--r-- 2016-08-24 15:28:23
Edit Download
2.28 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
2.88 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.27 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.42 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.48 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.21 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
4.93 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
807 B lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.67 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.83 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
82 B lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.33 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.22 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
898 B lrw-r--r-- 2016-08-24 15:28:23
Edit Download
2.31 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.06 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
950 B lrw-r--r-- 2016-08-24 15:28:23
Edit Download
1.91 KB lrw-r--r-- 2016-08-24 15:28:23
Edit Download
580 B lrw-r--r-- 2016-08-24 15:28:23
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).