Class: Dependabot::Uv::FileUpdater::LockFileUpdater

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/uv/file_updater/lock_file_updater.rb

Overview

rubocop:disable Metrics/ClassLength

Constant Summary collapse

REQUIRED_FILES =

At least one of these files should be present

%w(pyproject.toml uv.lock).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependencies:, dependency_files:, credentials:, index_urls: nil, repo_contents_path: nil, target_requirement: nil) ⇒ LockFileUpdater

Returns a new instance of LockFileUpdater.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 60

def initialize(
  dependencies:,
  dependency_files:,
  credentials:,
  index_urls: nil,
  repo_contents_path: nil,
  target_requirement: nil
)
  @dependencies = dependencies
  @dependency_files = dependency_files
  @credentials = credentials
  @index_urls = index_urls
  @repo_contents_path = repo_contents_path
  @target_requirement = target_requirement
  @prepared_pyproject = T.let(nil, T.nilable(String))
  @updated_lockfile_content = T.let(nil, T.nilable(String))
  @pyproject = T.let(nil, T.nilable(Dependabot::DependencyFile))
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



39
40
41
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 39

def credentials
  @credentials
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



33
34
35
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 33

def dependencies
  @dependencies
end

#dependency_filesObject (readonly)

Returns the value of attribute dependency_files.



36
37
38
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 36

def dependency_files
  @dependency_files
end

#index_urlsObject (readonly)

Returns the value of attribute index_urls.



42
43
44
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 42

def index_urls
  @index_urls
end

#repo_contents_pathObject (readonly)

Returns the value of attribute repo_contents_path.



45
46
47
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 45

def repo_contents_path
  @repo_contents_path
end

#target_requirementObject (readonly)

Returns the value of attribute target_requirement.



48
49
50
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 48

def target_requirement
  @target_requirement
end

Instance Method Details

#updated_dependency_filesObject



80
81
82
83
84
85
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 80

def updated_dependency_files
  @updated_dependency_files ||= T.let(
    fetch_updated_dependency_files,
    T.nilable(T::Array[Dependabot::DependencyFile])
  )
end