Class: Dependabot::Vcpkg::ManifestBaseline

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/vcpkg/manifest_baseline.rb

Overview

Finds the commit a manifest pins the built-in registry to.

This ignores any other registry, because the versions database shipped with the updater image only describes the built-in one.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependency_files:) ⇒ ManifestBaseline

Returns a new instance of ManifestBaseline.



21
22
23
24
25
# File 'lib/dependabot/vcpkg/manifest_baseline.rb', line 21

def initialize(dependency_files:)
  @dependency_files = dependency_files
  @ref = T.let(nil, T.nilable(String))
  @resolved = T.let(false, T::Boolean)
end

Instance Attribute Details

#dependency_filesObject (readonly)

Returns the value of attribute dependency_files.



28
29
30
# File 'lib/dependabot/vcpkg/manifest_baseline.rb', line 28

def dependency_files
  @dependency_files
end

Instance Method Details

#locationObject



41
42
43
44
45
46
# File 'lib/dependabot/vcpkg/manifest_baseline.rb', line 41

def location
  return [T.must(vcpkg_manifest_file).name, [VCPKG_BUILTIN_BASELINE_KEY]] if manifest_builtin_baseline
  return nil unless default_registry_builtin_baseline

  [T.must(vcpkg_configuration_file).name, %w(default-registry baseline)]
end

#refObject



31
32
33
34
35
36
# File 'lib/dependabot/vcpkg/manifest_baseline.rb', line 31

def ref
  return @ref if @resolved

  @resolved = true
  @ref = manifest_builtin_baseline || default_registry_builtin_baseline
end