Class: Dependabot::Python::FileUpdater::PipfileFileUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/python/file_updater/pipfile_file_updater.rb

Overview

rubocop:disable Metrics/ClassLength

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependencies:, dependency_files:, credentials:) ⇒ PipfileFileUpdater

Returns a new instance of PipfileFileUpdater.



21
22
23
24
25
# File 'lib/dependabot/python/file_updater/pipfile_file_updater.rb', line 21

def initialize(dependencies:, dependency_files:, credentials:)
  @dependencies = dependencies
  @dependency_files = dependency_files
  @credentials = credentials
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



19
20
21
# File 'lib/dependabot/python/file_updater/pipfile_file_updater.rb', line 19

def credentials
  @credentials
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



19
20
21
# File 'lib/dependabot/python/file_updater/pipfile_file_updater.rb', line 19

def dependencies
  @dependencies
end

#dependency_filesObject (readonly)

Returns the value of attribute dependency_files.



19
20
21
# File 'lib/dependabot/python/file_updater/pipfile_file_updater.rb', line 19

def dependency_files
  @dependency_files
end

Instance Method Details

#updated_dependency_filesObject



27
28
29
30
31
32
# File 'lib/dependabot/python/file_updater/pipfile_file_updater.rb', line 27

def updated_dependency_files
  return @updated_dependency_files if @update_already_attempted

  @update_already_attempted = true
  @updated_dependency_files ||= fetch_updated_dependency_files
end