Class: Dependabot::Helm::FileUpdater::LockFileGenerator

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

Instance Method Summary collapse

Constructor Details

#initialize(dependencies:, dependency_files:, repo_contents_path:, credentials:) ⇒ LockFileGenerator

Returns a new instance of LockFileGenerator.



26
27
28
29
30
31
# File 'lib/dependabot/helm/file_updater/lock_file_generator.rb', line 26

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

Instance Method Details

#updated_chart_lock(chart_lock, updated_content) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/dependabot/helm/file_updater/lock_file_generator.rb', line 34

def updated_chart_lock(chart_lock, updated_content)
  SharedHelpers.in_a_temporary_repo_directory(base_dir, repo_contents_path) do
    SharedHelpers.with_git_configured(credentials: credentials) do
      File.write("Chart.yaml", updated_content)
      Helpers.update_lock

      File.read(chart_lock.name)
    end
  end
end