Class: Dependabot::NpmAndYarn::FileUpdater::PnpmLockfileUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/npm_and_yarn/file_updater/pnpm_lockfile_updater.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PnpmLockfileUpdater.



16
17
18
19
20
21
# File 'lib/dependabot/npm_and_yarn/file_updater/pnpm_lockfile_updater.rb', line 16

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_pnpm_lock_content(pnpm_lock) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/dependabot/npm_and_yarn/file_updater/pnpm_lockfile_updater.rb', line 23

def updated_pnpm_lock_content(pnpm_lock)
  @updated_pnpm_lock_content ||= {}
  return @updated_pnpm_lock_content[pnpm_lock.name] if @updated_pnpm_lock_content[pnpm_lock.name]

  new_content = run_pnpm_update(pnpm_lock: pnpm_lock)
  @updated_pnpm_lock_content[pnpm_lock.name] = new_content
rescue SharedHelpers::HelperSubprocessFailed => e
  handle_pnpm_lock_updater_error(e, pnpm_lock)
end